File System Logging Configuration

This guide provides the exact .env file parameters required to set up File System logging. All logging settings are managed directly within your .env configuration file.

Step 1. Set the Log Level

To control the volume of diagnostic data generated by the application and prevent your storage from filling up with unnecessary debug information, set the global verbosity using the Serilog__MinimumLevel__Default parameter.

The available levels are Information, Debug, Warning, and Error.

Warning: Avoid Debug Mode in Production

It is highly recommended to keep the log level set to Errorfor regular day-to-day operations. You should only change this value to Debug if explicitly instructed by Sendent Support to capture detailed diagnostics for bug resolution. The Debug level generates a massive amount of data and can quickly consume disk space and degrade performance.

Step 2. Select the Log Output Destination

The application uses a bitwise mathematical configuration for the Service__LoggingConfiguration__LogsOutput parameter. To enable File System output, you must include the value 4.

Service__LoggingConfiguration__LogsOutput=4

If you wish to combine File System logging with other methods, simply sum their respective values (e.g., 1 for Console + 4 for File System = 5).

Step 3. Method-Specific Configuration

Because you are writing logs to the host machine's storage, you must configure the folder path and define log rotation limits in your .env file to prevent your hard drive from filling up.

# The name of the directory where log files will be saved (e.g., /SendentLogs/)
# Leaving this variable blank creates logs folder by default
Service__LoggingConfiguration__LogDirectoryPath=SendentLogs
 
# Maximum size of a single log file in Megabytes (MB)
Service__LoggingConfiguration__LogFileSizeLimit=50
 
# Maximum number of historical log files to retain before automatic deletion
Service__LoggingConfiguration__LogFileAmountLimit=20

Step 4. Accessing Your Logs

  1. Navigate to the directory you specified in the Service__LoggingConfiguration__LogDirectoryPath variable (e.g., /SendentLogs/).

  2. You can open these .txt files with any standard text editor (Notepad, VS Code).


Was this article helpful?