Skip to content
A Log Utility Using NLog
C# PowerShell
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
NLogUtility
nuget
packages
.gitattributes
.gitignore
LICENSE.txt
NLogUtility.sln
README.md

README.md

A Log Utility Using NLog

Build status NuGet package

1.static void Info(string module, string message, params object[] args)

the method will log info-level infomation to the file: 'D:\item\ApplicationName\{module}\{module}.log'

the historical log file will be archive to 'D:\item\ApplicationName\{module}\{module}_{shortdate}.log' and remain for 30 days

2.static void Trace(string module, string message, params object[] args)

the method will log trace-level infomation to the file: 'D:\item\ApplicationName\{module}\{module}.log'

the historical log file will be archive to 'D:\item\ApplicationName\{module}\{module}_{shortdate}.log' and remain for 30 days

3.static void Error(Exception ex, string message, params object[] args)

the method will log exception infomation with appended message to the file: 'D:\item\ApplicationName\error\error.log'

the historical log file will be archive to 'D:\item\ApplicationName\error\error_{shortdate}.log' and remain for 30 days

4.static void Error(Exception ex)

the method will log exception infomation to the file: 'D:\item\ApplicationName\error\error.log'

the historical log file will be archive to 'D:\item\ApplicationName\error\error_{shortdate}.log' and remain for 30 days

5.static void Error(string message, params object[] args)

the method will log will log message infomation to the file: 'D:\item\ApplicationName\error\error.log'

the historical log file will be archive to 'D:\item\ApplicationName\error\error_{shortdate}.log' and remain for 30 days

6.static void Alert(Exception ex, string message, params object[] args)

the method will send email with exception infomation include appended message to the related person

7.static void Alert(string message, params object[] args)

the method will send email with message to the related person

8.static void PureInfo(string module, string message, params object[] args)

the method will log just message without time information to the file: 'D:\item\ApplicationName\{module}\{module}.pure.log'

the historical log file will be archive to 'D:\item\ApplicationName\{module}.pure\{module}.pure_{shortdate}.log' and remain for 30 days

Attention:

the Trace method will take effect When change 'minlevel' value to 'Trace' in NLog.config file

the Alert method will take effect When change 'to','from','smtpUserName','smtpPassword' to appropriate value in Mail Target

You can’t perform that action at this time.