Question
CNO Financial Group
US
Last activity: 11 Oct 2018 9:19 EDT
Runtime Log Access Question
Hello,
Is there a way that users can get access to RuntimeLogs at runtime? So that I could review the log right away when an exception occurs?
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Ford Motor Company
US
HI,
You can leverage AES to send the recent alerts and exception from the recent alerts. Its give you 15mins period, you can extend if you want.
Regards,
Anandh
-
Sireesha konkimalla
Infosys
IN
Write below code to read runtime logs.
var logFiles = Directory.GetFiles("provide your runtime log directory path", "RuntimeLog*.txt");
ex: var logFiles = Directory.GetFiles("C:\Users\...\AppData\Roaming\OpenSpan", "RuntimeLog*.txt");
Above code will return all runtime logs files. If you want latest file then pass second values as "RuntimeLog.txt"
Pegasystems Inc.
US
I am not sure why you would want to access the logs at Runtime. When an exception occurs you can actually handle the exception directly. Logs should be used to triage a problem so that you can correct coding issues and add more exception handling to the code.
If you want users to send you logs when they have an issue, you can programatically check the CommonConfig,xml file for the location where files are being written - it is the ConfigurationLocation key that specifies that. You could create a mechanism for them to report an issue which would send the current log file. Best to zip the file if you are emailing it as they can get rather large over time. Check out this post with some examples for zipping a file using components installed with the Runtime.
-
Anthony Rowell Hirofumi Furusawa Amy Cornegay
CNO Financial Group
US
Thanks Jeff. My question was directed more at how end users might access the logs - should we have experienced end users that could understand logging.
Pegasystems Inc.
US
Logs are found by default in %appdata%\Roaming\OpenSpan if logging is enabled. Any user should have access to that location. If RuntimeLog logging is enabled there is a single file for the entire session (RuntimeLog.txt) - if Log4Net logging is enabled rolling logs will exist and logging for the session may be split between many files (Runtime_Log4Net.txt*). Here is a post that will help you get to the important data in a log quickly.
CNO Financial Group
US
Thank you Jeff! This is very helpful!
-
Darrell Embrey