SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Does 24x7 scheduler record messages sent to stdout?

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
Does 24x7 scheduler record messages sent to stdout?
Author Message
qdnguyen



Joined: 29 Sep 2009
Posts: 10
Country: United States

Post Does 24x7 scheduler record messages sent to stdout? Reply with quote
Hello,

We have our own logging system written in Java, and when it logs some message it also sends the message to the stdout. So if a job is run from the command line, the user should be able to see what is being sent to the log.

Does 24x7 listen to the stdout and keep the messages that was sent to the stdout anywhere?

Thanks
Thu Oct 01, 2009 1:26 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7952

Post Reply with quote
If you want to capture the output, you can specify output redirection on the command line, for example,

CMD /C myprogram.bat > c:\Logs\myprogram_@T"yyyymmdd_hhmmss".log

If you want both stdout and stderror

CMD /C myprogram.bat > c:\Logs\myprogram_@T"yyyymmdd_hhmmss".log 2>&1

You can also capture separately stdout and stderr; write to separate log files for every job instance, or append them to existing log files; or implement daily logs with rotation by using correct macro-parameters for file names and correct redirection symbols.

CMD /C myprogram.bat >> c:\Logs\myprogram_@T"yyyymmdd".log


To control the log history depth, you can use the FileDir utility http://www.softtreetech.com/24x7/archive/46.htm or something similar to periodically delete old log files, perhaps automatically delete job logs that are over 30 days old.
Thu Oct 01, 2009 2:11 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7952

Post Reply with quote
If you are running it on non-Windows system, you can use similar methods, using sh / c instead of cmd /C.


To automatically check the text captured from stdout, convert job to JavaScript job, read the log file after job run and scan it for errors, for example,
Process.runAndWait( ... );
log = File.readAll( ... );
if ( log.search( ... ) != -1 ) Mail.mailSend( ... ) or alternatively Scheduler.raiseError( ... )


If you need to do that for many jobs, I recommend to create a template and then use that template to quickly create the jobs.,
Thu Oct 01, 2009 2:19 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.