Skip to content

Commit

Permalink
Fix log4j config attribute (#629)
Browse files Browse the repository at this point in the history
* Fix log4j config attribute

* lint

---------

Co-authored-by: Alexandra Carrillo <[email protected]>
  • Loading branch information
lucassaldanha and alexandratran authored Jan 15, 2025
1 parent 0c24450 commit dfcc980
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions docs/how-to/monitor/configure-logging.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ The default Docker image location is `/root/.local/share/teku/logs`.

## Basic log level settings

Use the [`--logging`](../../reference/cli/index.md#logging) command line option to specify logging verbosity. The [`--logging`](../../reference/cli/index.md#logging) option changes the volume of events displayed in the log. Valid log levels are `OFF`, `FATAL`, `ERROR`, `WARN`, `INFO`, `DEBUG`, `TRACE`, `ALL`. The default level is `INFO`.
Use the [`--logging`](../../reference/cli/index.md#logging) command line option to specify logging verbosity.
The [`--logging`](../../reference/cli/index.md#logging) option changes the volume of events displayed in the log.
Valid log levels are `OFF`, `FATAL`, `ERROR`, `WARN`, `INFO`, `DEBUG`, `TRACE`, `ALL`. The default level is `INFO`.

By default most logging output is sent to the log file, and limited content shown on the console.

Expand All @@ -40,9 +42,11 @@ Additional logging options include:

## Configure log destination

Use the [`--log-destination`](../../reference/cli/index.md#log-destination) command line option to specify where to output log information. Valid options are `BOTH`, `CONSOLE`, `DEFAULT_BOTH`, `FILE`. Defaults to `DEFAULT_BOTH`.
Use the [`--log-destination`](../../reference/cli/index.md#log-destination) command line option to specify where to output log information.
Valid options are `BOTH`, `CONSOLE`, `DEFAULT_BOTH`, `FILE`. Defaults to `DEFAULT_BOTH`.

When using `BOTH` or `DEFAULT_BOTH`, system updates such as blockchain events are displayed on the console, and errors and other information are logged to a file. Specify the log file with the [`--log-file`](../../reference/cli/index.md#log-file) command-line option.
When using `BOTH` or `DEFAULT_BOTH`, system updates such as blockchain events are displayed on the console, and errors and other information are logged to a file.
Specify the log file with the [`--log-file`](../../reference/cli/index.md#log-file) command-line option.

Use `DEFAULT_BOTH` when using a [custom Log4J2 configuration file](#advanced-custom-logging). Any other option applies the custom logging changes on top of its default settings.

Expand All @@ -58,7 +62,7 @@ You can provide your own logging configuration using the standard Log4J2 configu

```xml title="debug.xml"
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="INFO">
<Configuration level="INFO">
<Properties>
<Property name="root.log.level">INFO</Property>
</Properties>
Expand All @@ -76,7 +80,8 @@ You can provide your own logging configuration using the standard Log4J2 configu
</Configuration>
```

To use your custom configuration, set the environment variable `LOG4J_CONFIGURATION_FILE` to the location of your configuration file, and ensure [`--log-destination`](../../reference/cli/index.md#log-destination) is not set to `DEFAULT_BOTH`.
To use your custom configuration, set the environment variable `LOG4J_CONFIGURATION_FILE` to the location of your configuration file, and ensure
[`--log-destination`](../../reference/cli/index.md#log-destination) is not set to `DEFAULT_BOTH`.

If you have more specific requirements, you can create your own [log4j2 configuration](https://logging.apache.org/log4j/2.x/manual/configuration.html).

Expand Down

0 comments on commit dfcc980

Please sign in to comment.