Re: Write to a text/log file (961 Views)
Reply
Advisor
Posts: 50
Registered: ‎04-22-2009
Message 1 of 5 (974 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
Posts: 74
Registered: ‎10-15-2010
Message 2 of 5 (965 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.
Highlighted
Honored Contributor
Posts: 989
Registered: ‎02-22-2011
Message 3 of 5 (961 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
Posts: 50
Registered: ‎04-22-2009
Message 4 of 5 (943 Views)

Re: Write to a text/log file

Neat! Thanks guys. Thanks for that very useful info.
Frequent Advisor
Posts: 74
Registered: ‎10-15-2010
Message 5 of 5 (927 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.