Re: Write to a text/log file (761 Views)
Reply
Advisor
Peeves02
Posts: 40
Registered: ‎04-22-2009
Message 1 of 5 (808 Views)
Accepted Solution

Write to a text/log file

Has anyone ever tried writing a message into a text file in SM7.11?  I don't want to send the messages into the sm.log file.  I want to use my own log file in the server.

 

Would appreciate any ideas on this one.

 

Regards.

 

 

Frequent Advisor
abhijitkhewale
Posts: 74
Registered: ‎10-15-2010
Message 2 of 5 (799 Views)

Re: Write to a text/log file

Hi P, Use javascript to achieve this. As rtecall("log") print message in sm.log file only.
Honored Contributor
-m-
Posts: 989
Registered: ‎02-22-2011
Message 3 of 5 (795 Views)

Re: Write to a text/log file

As Abhijit stated, Service Manager provides a JavaScript global method named writeFile (see Help Server). The documentation states it writes data to the local file system. It is important to note that SM supports server-side JavaScript only so the "local file system" is the server (not the user's client machine).

Advisor
Peeves02
Posts: 40
Registered: ‎04-22-2009
Message 4 of 5 (777 Views)

Re: Write to a text/log file

Neat! Thanks guys. Thanks for that very useful info.
Frequent Advisor
abhijitkhewale
Posts: 74
Registered: ‎10-15-2010
Message 5 of 5 (761 Views)

Re: Write to a text/log file

Appreciate KUDOS.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.