Typically, people use file-based logs. There is no problem with this, but it is easier to use Windows to provide system internal logs.
If you have administrative privileges, you can create a new log at any time:
Copy Code code as follows:
New-eventlog-logname Mylog-source Jobdue, Jobdone, remark
This command creates a log called MyLog, which originates from "Jobdue", "Jobdone" and "remark". Admin permissions are just to create the log, the rest of the operation can be operated by other users. You can now add a new record to your log.
Copy Code code as follows:
Write-eventlog-logname mylog-source jobdue-entrytype Information-eventid 1-message ' This could to be a job description. '
Write-eventlog-logname mylog-source jobdue-entrytype Information-eventid 1-message ' This could to another job Descrip tion. '
In addition Get-eventlog, you can easily use it to analyze your log and query log information:
Copy Code code as follows:
Get-eventlog-logname Mylog-source Jobdue-after 2014-05-10
And Limit-eventlog, which allows you to adjust the maximum size of your log.