rutgermons
asked on
logging errors
folks
how does one trigger a log file(i.e. capture.log) to capture specific errors from another log file (system.log) the moment they occur?
the system log file is a system generated log file
how does one trigger a log file(i.e. capture.log) to capture specific errors from another log file (system.log) the moment they occur?
the system log file is a system generated log file
..maybe i have not understood your question... you want to "tail" a log file in real time ? And export some errors ?
If yes, you can use Powershell with something like this :
Get-Content myTestLog.log -wait | where { $_ -match “WARNING” } |out-file log.txt -append
This script will read in realtime your log file & export errors with 'warning" on an other log file.
If yes, you can use Powershell with something like this :
Get-Content myTestLog.log -wait | where { $_ -match “WARNING” } |out-file log.txt -append
This script will read in realtime your log file & export errors with 'warning" on an other log file.
ASKER
ah, brilliant! mind me asking, can this also filter warnings logged within a certain time stamp?
each warning or error contains a date and timestamp so ideally i dont want to see older warnings, only new ones
cheers
each warning or error contains a date and timestamp so ideally i dont want to see older warnings, only new ones
cheers
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
your_command > log-ok-file.log 2> log-error.log
log-ok-file.log will log all your command result
log-error.log will only log errors