Logging routes can be configured to write logs to separate external .log files. These files can later be opened for viewing in the Diagnostics Console or in a text editor such as Notepad.
To configure Hyland.Logging to write log files:
- Open the .json file in a plain-text editor.
- Locate the Hyland.Logging element.
Add the following logging route to the Routes element:
- Replace "FILEPATH" with the file path for the log file, including the name of the file you want the log to be saved as. This file must be a .log file. For example, "./logs/ApiServer.log" would write the logs to a file called ApiServer.log in the /logs directory within the directory where the application is installed.
To refine the severity of messages saved in the file, you can edit the attribute for minimum and maximum logging levels:
The Minimum-Level attribute limits the lowest-severity log level that is received.
You can add a Maximum-Level attribute, which limits the highest-severity log level that is received.
The values for these attributes can be set to any of the following log level severities, listed from most severe to least severe.
Log level names are case sensitive.
Logs that describe an unrecoverable application, system crash, or catastrophic failure that requires immediate attention.
Logs that highlight when the current flow of execution is stopped due to a failure. These logs indicate a failure in the current activity, but not an application-wide failure.
Logs that highlight an abnormal or unexpected event in the application flow but do not otherwise cause the application to stop.
Logs that track the general flow of the application.
Logs that are used for interactive investigation during development.
Logs that contain the most detailed messages and may include sensitive data. These logs should never be enabled in a production environment.
A logging category that does not write any logging messages.
For example, a route in the .json file could be edited to include the following attributes:
This example specifies that the file only includes logging messages with a severity level of Debug or above, and it receives no messages with a higher severity level than Error.Note:
The default severity level of a route is a minimum of Information and a maximum of Critical. The route uses these severity levels if it does not include a Minimum-Level or Maximum-Level line specified in the .json file.
Set the "FileRollInterval" attribute to the interval
that you want a new log created. The following intervals are available for
A new log file is created every minute.
A new log file is created every hour.
A new log file is created every day.
A new log file is created every month.
A new log file is created every year.
A new log is never created.
- Set the "FileRollOnSize" attribute to "true" or "false" to limit log files based on size. If set to "true", a new log file to be created when the current log file reaches the configured size limit.
- Set the "FileCountLimit" attribute to the number of log files to be kept before older files are deleted. If you do not want to delete older files, you can set the value to "null".
- Set the "FileByteLimit" attribute to the maximum size in bytes a log file can be before creating a new file. This attribute is only active if "FileRollOnSize" is set to "true".
- Save the file and close the text editor.
- Restart the app pool running the application for the changes to take effect.