Modify the Notifications.UserNLog.config file
- Last UpdatedOct 02, 2024
- 1 minute read
- PI System
- PI Server 2024 R2
- PI Server
Modify the Notifications.UserNLog.config file to enable different levels of logging, change the log file name or location, or add custom logging targets and rules.
Note: The Notifications.UserNLog.config file is not over-written when PI Notifications Service is upgraded. For this reason, changes that you want to preserve across upgrades must be made in the Notifications.UserNLog.config file, and not in the PINotifications.exe.config file.
-
Navigate to the file %PIHOME64%\Notifications.
-
Open the Notifications.UserNLog.config file in an editor.
-
Make changes to the settings in the Notifications.UserNLog.config file.
To ...
Set ...
Enable detailed logging
<logger name="OSIsoft.PINotifications*" minlevel="Trace" maxlevel="Debug" writeTo="PINotificationsLogfile" enabled="true"/>
Change the log file location
<variable name="logPath" value="${specialfolder:folder=CommonApplicationData}\OSIsoft\PINotifications\Logs"/>
Change the log file name
<variable name="logfileName" value="$(logPath)\pinotifications-log.txt"/>
Note: If there are errors in the Notifications.UserNLog.config, logging options in PINotifications.exe.config file will apply.
-
Save the Notifications.UserNLog.config file.
PI Notifications Service does not need to be restarted to initiate the changes made in this file.