Any one can suggest, to write the event log to the text file. Its kind of a alerting. Already a service for alerting is there via email. Same concept to do the log to text file.
It is stored in Ens.Util.Log class, so you can easily export it to csv/html/xml/pdf/txt from SQL. Here's a sample export to CSV:
set rs = ##class(%SQL.Statement).%ExecDirect(,"SELECT * FROM Ens_Util.Log")
set file = "C:\InterSystems\Ensemble\mgr\Temp\Ens.Log"
do rs.%DisplayFormatted(100, file) // 100 for CSV format
Assumedly, you also may only want to see "new" additions to the log file. My thoughts on this would be as follows;
Method 1 - Using COS code throughout
Take a snapshot of the existing ens.log/cconsole.log, loading it into Cache as an Object/Global
Every "n" seconds, rescan the existing log file.
If new lines have appeared report them, write to text file, email, text etc. them
Goto step 1
Method 2 - Using OS tools
Take a snapshot of the existing log file into a copy text file
Every "n" seconds, use an OS tool to compare this file with the current log file (e.g. diff in Unix etc.)
If different, report the differences, write to text file, email, text etc. them
Goto step 1
If you really only want "...to write the event log to the text file..." then you can either use COS or a simple copy command at the OS level to copy the log file to another text file
Ensemble event log?
It is stored in Ens.Util.Log class, so you can easily export it to csv/html/xml/pdf/txt from SQL. Here's a sample export to CSV:
Docs for %DisplayFormatted.
Where can I find that file?
Assumedly, you also may only want to see "new" additions to the log file. My thoughts on this would be as follows;
Method 1 - Using COS code throughout
Method 2 - Using OS tools
If you really only want "...to write the event log to the text file..." then you can either use COS or a simple copy command at the OS level to copy the log file to another text file