Here are some best practices to ensure your logs are structured, accessible, and optimized for performance:
Separate Logs by Vault #
Store logs for each vault in a dedicated folder to simplify locating relevant information when troubleshooting or analyzing activities.
Use the Appropriate Logging Level #
For normal system operation, it’s best to use the Info logging level for a balance of detail and performance.
Customize File Log Format #
Define a clear and consistent log format for easier readability and analysis. In the Advanced Settings of the File Targets configuration, you can customize log formatting. If you want to maintain the formatting of previous log structures (pre-v5.0.0), we recommend using the following custom Log Message Format:
${longdate} [${level:uppercase=true:padding=3}] ${logger} [Task: ${mdlc:TaskID}] [${mdlc:ModuleName}] ${mdlc:Vault} ${mdc:Rules} ${message}${onexception:${newline}${exception:format=ToString:innerformat=ToString:separator=\r\n}}
For more details, refer to this page: Version 5.0.0 of Extension Kit for M-Files released! – Announcements – Unitfly Community.
Set a Log Retention Period #
Define the retention period for logs based on the specific needs of each vault. This helps manage storage while retaining essential data for audits or debugging.
Define Maximum File Size #
It’s crucial to set a maximum file size to ensure logs remain accessible and can be easily opened and reviewed, especially if you use a one-file-per-day configuration.