Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Docs] Add option to log messages in JSON #4931

Merged
merged 2 commits into from
Sep 11, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 18 additions & 11 deletions libbeat/docs/loggingconfig.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ the logging output configuration from the command line. See
You can specify the following options in the `logging` section of the +{beatname_lc}.yml+ config file:

[float]
==== `to_syslog`
==== `logging.to_syslog`

When true, writes all logging output to the syslog.

[float]
==== `to_files`
==== `logging.to_files`

When true, writes all logging output to files. The log files are automatically
rotated when the log file size limit is reached.
Expand All @@ -56,7 +56,7 @@ there will be no log file in the directory specified for logs.

[float]
[[level]]
==== `level`
==== `logging.level`

Minimum log level. One of `debug`, `info`, `warning`, `error`, or `critical`.
The default log level is `info`.
Expand All @@ -79,7 +79,7 @@ that are published. Also logs any warnings, errors, or critical errors.

[float]
[[selectors]]
==== `selectors`
==== `logging.selectors`

The list of debugging-only selector tags used by different Beats components. Use `*`
to enable debug output for all components. For example add `publish` to display
Expand All @@ -88,7 +88,7 @@ selectors can be overwritten using the `-d` command line option (`-d` also sets
the debug log level).

[float]
==== `metrics.enabled`
==== `logging.metrics.enabled`

If enabled, {beatname_uc} periodically logs its internal metrics that have
changed in the last period. For each metric that changed, the delta from the
Expand All @@ -107,37 +107,39 @@ metrics and for this reason they are also not documented.


[float]
==== `metrics.period`
==== `logging.metrics.period`

The period after which to log the internal metrics. The default is 30s.

[float]
==== `files.path`
==== `logging.files.path`

The directory that log files are written to. The default is the logs path. See the
<<directory-layout>> section for details.

[float]
==== `files.name`
==== `logging.files.name`

The name of the file that logs are written to. By default, the name of the Beat
is used.

[float]
==== `files.rotateeverybytes`
==== `logging.files.rotateeverybytes`

The maximum size of a log file. If the limit is reached, a new log file is generated.
The default size limit is 10485760 (10 MB).

[float]
==== `files.keepfiles`
==== `logging.files.keepfiles`

The number of most recent rotated log files to keep on disk. Older files are
deleted during log rotation. The default value is 7. The `keepfiles` options has to be
in the range of 2 to 1024 files.

[float]
==== `files.permissions`
==== `logging.files.permissions`

//REVIEWERS: Noticed that his is not in the beat.reference.yml file. Should it be? Or is the option old?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it should be in there too. Can you please add it to config.reference.yml and run make update from the top-level?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@andrewkroh Added. Can you review the changes? Thanks!


The permission mask to apply when rotating log files. The default value is 0600. The
`permissions` options must be a valid Unix-style file permissions mask expressed
Expand All @@ -149,6 +151,11 @@ Examples:
* 0664: give read and write access to the file owner and members of the group
associated with the file, as well as read access to all other users.

[float]
==== `logging.json`

When true, logs messages in JSON format. The default is false.

[float]
=== Logging format

Expand Down