The logging framework integrations feature with Aptify is now available to help you monitor the health of your product and troubleshoot any problems you might have.
This allows us to add generic logging diagnostics to the product and allow our customers the flexibility to log to whatever infrastructure they want (event viewer, flat files, Splunk, the database, and so on)
The configuration and use of the integration of Logging Framework with Aptify are described in the following documents:
- Configuring Logging Framework
- Different configuration options to turn logging On/Off for explicit entities and users
- List of Instrumented areas
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
For integrating the Logging Framework, following are the configuration options using which we can turn logging on or off for explicit entities and users:
-
The common thing that needs to be added to see logging on or off for explicit entities and users is,
<add key="serilog:using:FilterExpressions" value="Serilog.Filters.Expressions" />
- To turn logging On/Off for explicit entities or classes,
- To turn On, add the following configuration keys,
<add key="serilog:filter:ByIncluding.expression" value="SourceContext = 'GenericEntity'" />
Where 'Generic entity' is just an example of a class name for which you want to see logging. - To turn it Off, you just need to remove the above-mentioned configuration key from the file.
- To turn On, add the following configuration keys,
- Turn logging On/Off for explicit users,
- To turn On, add the following configuration keys,
<add key="serilog:filter:ByIncluding.expression" value="UserName = 'TestUser'" />
Where 'TestUser' is just an example of a username for which you want to see logging. - To turn it Off, you just need to remove the above-mentioned configuration key from the file.
- To turn On, add the following configuration keys,
Customizing config options for Aptify specific items we put into the OutputTemplate
For customizing config options for Aptify specific items we put into the OutputTemplate, you can edit the below given configuration key in the file:
<add key="serilog:write-to:RollingFile.outputTemplate" value="[{Timestamp:hh:mm:ss}
{Level:u3}] [UserCredentials: {UserContext}] [ClassName:{SourceContext}] {Message}
List of Instrumented areas
The below list shows the different areas where we have instrumented logging Framework for Aptify:
- AptifyGenericEntity:
Save InnerValidate FireEvent - AptifySubtype.vb:
DoSubtypeSave - AptifyExceptionManagement:
SerilogPublisher - AptifyProcessFlowEngine:
ExecuteProcessFlow
ValidateExecutionRuleAndRun - AptifyAsyncProcessor
- AptifyShell.vb
- SOADataServicesTokenValidation
Comments
Please sign in to leave a comment.