This page details down the step-by-step instructions to configure Logging Framework implementation.
Prerequisite
- Aptify 6.2 3 or higher version up and running
...
- Go to folder structure where Aptify is installed. (For example- C:\Program Files\Aptify 5.0)
Search and open the appropriate config file for the application as shown below.
Sr No Application File Name 1 Smart Client AptifyShell.exe
2 Aptify Web Web.Config 3 Async Processor AptifyAsyncProcessor.exe
Under <appSettings> section, add the below given keys.
Expand title Click here to view... <add key="serilog:using:RollingFile" value="Serilog.Sinks.RollingFile" />
<add key="serilog:write-to:RollingFile.pathFormat" value="Your local system path" />
<add key="serilog:write-to:RollingFile.outputTemplate" value="
[{Timestamp:hh:mm:ss}{Level:u3}] [UserCredentials: {UserContext}] [ClassName:{SourceContext}]{Message} {NewLine}{Exception}" />
<add key="serilog:write-to:RollingFile.rollingInterval" value="Day" />
<add key="serilog:write-to:RollingFile.rollOnFileSizeLimit" value="true" />
<add key="serilog:write-to:RollingFile.shared" value="true" />
<add key="serilog:minimum-level" value="Information" />
<add key="Aptify.Framework.LoggerFactory.isLoggingDisabled" value="False" />- Add file path as shown below, where the generated log file will be placed in the path format app setting of the config file.
Name of app setting - "serilog:write-to:RollingFile.pathFormat" Value= “add file path here”
For example – “c:\\foldername\\log.txt” - Login to Application (Smart Client/Aptify Web/Async Processor).
- On successful login, verify firing of log user context event by checking the log file.
In the log file, you can see the user credentials are logged with the correct user and check for other entity relation data like person, employee, or web user (if available).
...