# Logging

By default NetObserv can be configured to log to stdout or to a file. It can also be configured to log with `json` or `console` formatting. If logging to a file, log rotation can be configured to manage the volume of logs.

#### EF\_LOGGER\_LEVEL

Specifies the output level for logging.

* Valid Values
  * `debug`, `info`, `warn`, `error`, `panic`, `fatal`
* Default
  * `info`

#### EF\_LOGGER\_ENCODING

Specifies the output format of the produced logs.

* Valid Values
  * `console`, `json`
* Default
  * `json`

#### EF\_LOGGER\_FILE\_LOG\_ENABLE

Set to `true` to enable writing logs to a file.

* Valid Values
  * `true`, `false`
* Default
  * `false`

#### EF\_LOGGER\_FILE\_LOG\_FILENAME

If file logging is enabled (`EF_LOGGER_FILE_LOG_ENABLE` is `true`) this option specifies the path to the file where the logs will be written.

* Default
  * NetObserv Flow: `/var/log/elastiflow/flowcoll/flowcoll.log`
  * NetObserv SNMP: `/var/log/elastiflow/snmpcoll/snmpcoll.log`

#### EF\_LOGGER\_FILE\_LOG\_MAX\_SIZE

This option specifies the maximum size in megabytes of the log file before it is rotated. The default is `100` megabytes.

* Valid Values
  * Any integer greater than `1`.
* Min Value
  * `1`
* Default
  * `100`

#### EF\_LOGGER\_FILE\_LOG\_MAX\_AGE

This option specifies the maximum number of days to retain old log files based on the timestamp encoded in their filename. Note that a day is defined as 24 hours and may not exactly correspond to calendar days due to daylight savings, leap seconds, etc. The default is not to remove old log files based on age.

* Valid Values
  * Any integer greater than or equal to `0`.
* Default
  * `''`

#### EF\_LOGGER\_FILE\_LOG\_MAX\_BACKUPS

This option specifies the maximum number of old log files to retain. The default is to retain 4 old log files.

{% hint style="info" %}
Log files may be removed due to there age, as configured by `EF_LOGGER_FILE_LOG_MAX_AGE`, even if the maximum number of backups isn't reached.
{% endhint %}

* Valid Values
  * Any integer greater than or equal to `0`.
* Default
  * `4`

#### EF\_LOGGER\_FILE\_LOG\_COMPRESS

Set to `true` to enable compression of log files.

* Valid Values
  * `true`, `false`
* Default
  * `false`


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.elastiflow.com/flowcoll/configuration/config_gen/logging.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
