SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Logging of Errors

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
Logging of Errors
Author Message
Joshua Youngblood



Joined: 14 Apr 2006
Posts: 82
Country: United States

Post Logging of Errors Reply with quote
We're running the following code that we expect to not find a file occasionally:
Code:

onerrorresumenext
filesize source_file_path, file_size
...


The onerrorresumenext is correctly allowing the script to continue, but the error ("A run-time error occurred while executing automation script: Line ##. File not found.") is still being logged. Is there any way to prevent the logging by 24x7? We do not want to prevent the logging of all errors in the script. We just want to prevent the logging of the expected error.
Mon Sep 21, 2009 3:34 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7952

Post Reply with quote
This is being logged as a warning, not as an error. Am I right?
I guess you can suppress this logging if you check "Ignore Errors" job property. You can always write your custom errors and messages to the log using LogAddMessageEx statement. Hope it works for you.
Mon Sep 21, 2009 4:48 pm View user's profile Send private message
Joshua Youngblood



Joined: 14 Apr 2006
Posts: 82
Country: United States

Post Reply with quote
Quote:
This is being logged as a warning, not as an error. Am I right?

A: In the log file, what would indicate that it's a warning? Yes, the script continues without crashing, but the log message generated by 24x7 uses the word "error".

Quote:
I guess you can suppress this logging if you check "Ignore Errors" job property. You can always write your custom errors and messages to the log using LogAddMessageEx statement.

Response: Can the "Ignore Errors" property be set and unset by the job while it is running? We cannot "Ignore Errors" for the entire job. We can only do it for the "filesize" check that I showed you in the previous example. We would still like the program to crash and/or log all other non-custom errors.
Mon Sep 21, 2009 5:09 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7952

Post Reply with quote
On the screen, in the Log Viewer warning messages are displayed using yellow warning icons. In the log file they are represented by value 1 in the message type column - this is the second column from left. Just in case, 0 type means INFO, 1 - WARNIG, 2 - ERROR.


To avoid the entire issue with not found file, you can add FileExists check (or better use Dir) and analyze the result before calling FileSize.
Mon Sep 21, 2009 5:24 pm View user's profile Send private message
Joshua Youngblood



Joined: 14 Apr 2006
Posts: 82
Country: United States

Post Reply with quote
You are correct, then. It is being logged as a warning. Thanks for the information. It is enough to help me get the desired results.

I cannot use FileExists, because it returns true even if the file isn't finished being written, yet. See a previous post that I did in December of 2008, entitled "File Move Issues".
Mon Sep 21, 2009 5:38 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7952

Post Reply with quote
Quote:
I cannot use FileExists, because it returns true even if the file isn't finished being written


Understand.

I only meant using FileExists or Dir before calling FileSize, and only calling FileSize in case the FileExists check returns TRUE.
Mon Sep 21, 2009 5:55 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.