Configuring Logging Framework
This page details down the step-by-step instructions to configure Logging Framework implementation.
Prerequisite
- Aptify 6.3 or higher version up and running
Configuration Steps
By default, there is no setting present in the config file of applications for Smart Client, Aptify Web, and Async Processor. Thus, logging will be disabled.
<add key=" Aptify.Framework.LoggerFactory.isLoggingDisabled" value="false" />
Configuring logging framework with Smart Client, Aptify Web, and Async Processor
Please follow the below given configuration steps of the integration of the Logging framework with Aptify:
- 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.
- 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).
Note
For getting error and process flow information to be logged in the log file instead of event viewer
You need to add following key in the exception management section of config files of different applications.
<publisher mode="on" days="3" assembly="AptifyExceptionManagement"
type="Aptify.Framework.ExceptionManagement.SerilogPublisher"/>
Verification steps:
- Login to Aptify application with valid user and update a person record.
- Check the log file in this case, the log file should have logged correct updated data with detailed actions.
- Try saving person record without adding data in one of the mandatory fields. Check the log file here if the log file is giving a valid error message and it is explanatory.
Sample log file generated for an entity action
Once you generate a log file for an entity action, you can see the below-given information:
- Time Stand
- User Credentials
- Class Name
- Source Contest