Logging to File - Identity and Access Management Services - 4.4 - 4.4 - Ready - Other - external

Identity and Access Management Services

Platform
Other
Product
Identity and Access Management Services
Release
4.4
License

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:

  1. Open the .json file in a plain-text editor.
  2. Locate the Hyland.Logging element.
  3. Add the following logging route to the Routes element:

    "FileRoute": {

    "File": "FILEPATH",

    "OutputFormat": "JSON",

    "Maximum-Level": "Critical",

    "Minimum-Level": "Information",

    "FileRollInterval": "Day",

    "FileRollOnSize": true,

    "FileCountLimit": 30,

    "FileByteLimit": 10485760

    }

  4. 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.
  5. 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.

    Note:

    Log level names are case sensitive.

    Log Level

    Description

    Critical

    Logs that describe an unrecoverable application, system crash, or catastrophic failure that requires immediate attention.

    Error

    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.

    Warning

    Logs that highlight an abnormal or unexpected event in the application flow but do not otherwise cause the application to stop.

    Information

    Logs that track the general flow of the application.

    Debug

    Logs that are used for interactive investigation during development.

    Trace

    Logs that contain the most detailed messages and may include sensitive data. These logs should never be enabled in a production environment.

    None

    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:

    "Minimum-Level": "Debug",

    "Maximum-Level": "Error"

    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.

  6. Set the "FileRollInterval" attribute to the interval that you want a new log created. The following intervals are available for use:

    Interval

    Description

    Minute

    A new log file is created every minute.

    Hour

    A new log file is created every hour.

    Day

    A new log file is created every day.

    Month

    A new log file is created every month.

    Year

    A new log file is created every year.

    Infinite

    A new log is never created.

  7. 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.
  8. 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".
  9. 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".
  10. Save the file and close the text editor.
  11. Restart the app pool running the application for the changes to take effect.