Introduction to Anzo Logging
This topic provides an introduction to Anzo logging concepts, an overview of the Logging user interface, and information about the type of logging that is enabled by default. It also gives a high-level overview about adding new logging, adjusting the level of information that is logged, and reviewing log files.
- Logging Concepts
- Default Logging Configuration
- Adding Log Packages
- Log Level Definitions
- Viewing Log Files
Logging Concepts
In order to give users granular control and flexibility over the type and breadth of information that is captured, the concept of Log Packages is integral to logging in Anzo. A Log Package is a listener for events that are related to a particular Semantic Service or component, such as core system, LDAP, Anzo Unstructured, or AnzoGraph events. To give users flexibility over the depth of information that is logged, each Log Package can be configured to capture events at a certain Log Levels, from all events to fatal events only.
Default Logging Configuration
Logging is managed in the Administration application. To view the Log Packages that are enabled for your server, expand the Monitoring & Diagnostics menu in the Administration application and click Logging. The Log Levels tab is displayed, showing the enabled Log Packages and their Log Level configuration. For example, the image below shows the default configuration for a new installation:
Default Log Packages
The table below describes Log Packages that are enabled by default as well as their default Log Level. Log Levels are defined in Log Level Definitions below.
Package | Level | Description |
---|---|---|
AuditLog | Error | Listener for audit events, such as user logins and security events when the appropriate packages are enabled. For more information, see Enabling and Viewing User Audit Logs. |
com.cambridgesemantics | Error | Like the org.openanzo package, this base package listens for core system events. Changing the Log Level of this package affects logs across Anzo components and services. |
InstallUpdateLog | Info | Listener for installation and upgrade events. Captures information about bundle imports and updates. |
org.apache.directory | Off | Listener for events related to the underlying internal LDAP server. Do not modify the Log Level for this package. |
org.openanzo | Error | Like the com.cambridgesemantics package, this base package listens for core system events. Changing the Log Level of this package affects logs across Anzo components and services. |
org.openanzo.client.registry.RegistryManifestLoader | Info | Listener for installation and upgrade events. Captures information about bundle imports and updates. |
org.openanzo.combus.endpoint.BaseServiceListener | Error | Core server listener for requests sent from clients to the server. |
org.openanzo.osgi.bootstrap.BootstrapActivator | Info | Listener for installation and upgrade events. Captures information about bundle imports and updates. |
org.openanzo.services.PublicLog | Off | Listener for internal Anzo events. Do not modify the Log Level for this package. |
org.pac4j.http.client.direct.DirectBasicAuthClient | Off | Low-level listener for user login events. |
org.pac4j.http.client.direct.HeaderClient | Off | Low-level listener for user login events. |
TimingStack | Error | Listener for events related to internal system journal queries. |
Adding Log Packages
For guidance on adding the recommended Log Packages, see Adding the Recommended Log Packages.
To enable additional Log Packages, click the Edit button on the Log Levels screen.
Then click Add Package at the bottom of the screen.
Clicking the Select field opens the package drop-down list. You can browse through the options, or you can start typing a keyword to search for a package. Click a package to add it to the list of packages on the Edit Log Packages screen. Adjust the Log Level as needed and then click Save to save the change. See Log Level Definitions below for more information about Log Levels.
Log Level Definitions
This section defines the Log Levels that are available to apply to a Log Package:
- Off: Turns logging off for the Log Package.
- Debug: Logs fine-grained error messages that are intended to help debug a problem with an application or the server.
- Trace: Logs finer-grained error information than Debug.
- Info: The highest level of logging. The Log Package captures all events or queries.
- Warn: Logs information about potentially problematic situations.
- Error: Logs errors that usually allow the application to continue running.
- Fatal: Logs severe errors that prevent the application from running.
To change the Log Level for a package, click the Edit button at the top of the screen. On the Edit Log Packages screen, click the Log Level field for the Log Package that you want to change and select a level from the drop-down list. Click Save when you are finished making changes.
Viewing Log Files
All Anzo log files are generated in the <install_path>/Server/logs
directory on the server. Files in that directory can be viewed and downloaded from the Administration application on the Log Files tab on the Logging screen.
Viewing Logs on the Server
To avoid generating large log files that are difficult to manage (especially for Log Packages set to Info), Anzo starts logging to a new version of a file when any of the following events occur:
- A file size reaches 50 MB.
- Log settings are changed.
- Anzo is restarted.
The current, most recent version of a file is stored directly in the <install_path>/Server/logs
directory. Earlier versions of the files are saved in <year>_<month>_<day>_<part>
subdirectories in Server/logs
. For example:
logs ├── 2021_04_27_0 │ ├── anzo_audit_info.log │ ├── anzo_error.log │ ├── anzo_full.log │ ├── anzo_gqe_info.log │ └── anzo_internal_error.log ├── 2021_04_27_1 │ ├── anzo_audit_info.log │ ├── anzo_datasource_error.log │ ├── anzo_error.log │ ├── anzo_full.log │ ├── anzo_gqe_error.log │ ├── anzo_gqe_info.log │ ├── anzo_install_error.log │ └── anzo_install_info.log ├── 2021_04_28_0 │ ├── anzo_audit_info.log │ ├── anzo_error.log │ ├── anzo_full.log │ ├── anzo_gqe_info.log │ ├── anzo_install_error.log │ └── anzo_install_info.log ├── 2021_04_28_1 │ ├── anzo_error.log │ └── anzo_full.log ├── 2021_04_28_2 │ ├── anzo_audit_info.log │ ├── anzo_error.log │ └── anzo_full.log ├── anzo_audit_info.log ├── anzo_error.log ├── anzo_full.log ├── anzo_gqe_info.log ├── anzo_install_error.log ├── anzo_install_info.log ├── anzo_internal_error.log
AnzoGraph query log files are stored in a directory named gqe in the <install_path>/Server/logs
directory. By default all queries that are unsuccessful are captured in the queriesError directory. When the AnzoGraph queries Log Package is enabled, successful queries are also captured in the queriesInfo directory. For example:
logs ├── gqe │ ├── queriesError │ └── queriesInfo │ ├── query_1a5548ac-6404-4321-b36b-d5eda4ca45a7_1619540406734.log │ ├── query_1a5548ac-6404-4321-b36b-d5eda4ca45a7.log │ ├── query_292f102e-d222-4261-a069-d7d0c8ceb823_1619469563646.log │ ├── query_292f102e-d222-4261-a069-d7d0c8ceb823.log │ ├── query_2ddc5f96-758d-4133-80d7-21de5f23134f_1619627154151.log │ ├── query_2ddc5f96-758d-4133-80d7-21de5f23134f.log │ ├── query_518ombnsruyvu8k6pf0a76y4fc-674.log
For instructions on enabling the AnzoGraph query Log Package, see Enabling and Viewing AnzoGraph Query Logs.
Viewing Logs in the Administration Application
Logs in the <install_path>/Server/logs
directory can be viewed and downloaded from the Administration application on the Log Files tab on the Logging screen. The Log Files tab lists the logs that are available to view. For example:
Log Packages that have the Log Level set to Error log events to files with the suffix _error. Operational information that is logged by packages that are set to Info is captured in files with the suffix _info. The current versions the log files are shown at the top of the list. Earlier versions of the logs are prefixed with the name of the <date>_<part>
subdirectory they are saved in.
Selecting a log from the list displays its contents in the Logging Details section of the screen. For example:
The following options are available for viewing and downloading log files:
- To download a .zip file that contains all of the listed logs, click the Download All Logs button at the top of the screen.
- To download just the query error logs for AnzoGraph, click the Download All AnzoGraph Query Errors button at the top of the screen.
- To re-load the display with the latest version of the selected file, click the Refresh button at the top of the details.
- To download the file so you can view it in another editor, click Download File at the top of the details.