Skip to content

Commit

Permalink
[Docs] Add option to log messages in JSON (elastic#4931)
Browse files Browse the repository at this point in the history
* [Docs] Add option to log messages in JSON

* Add logging.files.permissions to full reference yml file

Edit description of file permissions
  • Loading branch information
dedemorton authored and ruflin committed Sep 27, 2017
1 parent 60d0c51 commit ae1e6d9
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 13 deletions.
4 changes: 4 additions & 0 deletions auditbeat/auditbeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -812,5 +812,9 @@ logging.files:
# Number of rotated log files to keep. Oldest files will be deleted first.
#keepfiles: 7

# The permissions mask to apply when rotating log files. The default value is 0600.
# Must be a valid Unix-style file permissions mask expressed in octal notation.
#permissions: 0600

# Set to true to log messages in json format.
#logging.json: false
4 changes: 4 additions & 0 deletions filebeat/filebeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1203,5 +1203,9 @@ logging.files:
# Number of rotated log files to keep. Oldest files will be deleted first.
#keepfiles: 7

# The permissions mask to apply when rotating log files. The default value is 0600.
# Must be a valid Unix-style file permissions mask expressed in octal notation.
#permissions: 0600

# Set to true to log messages in json format.
#logging.json: false
4 changes: 4 additions & 0 deletions heartbeat/heartbeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -961,5 +961,9 @@ logging.files:
# Number of rotated log files to keep. Oldest files will be deleted first.
#keepfiles: 7

# The permissions mask to apply when rotating log files. The default value is 0600.
# Must be a valid Unix-style file permissions mask expressed in octal notation.
#permissions: 0600

# Set to true to log messages in json format.
#logging.json: false
4 changes: 4 additions & 0 deletions libbeat/_meta/config.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -747,5 +747,9 @@ logging.files:
# Number of rotated log files to keep. Oldest files will be deleted first.
#keepfiles: 7

# The permissions mask to apply when rotating log files. The default value is 0600.
# Must be a valid Unix-style file permissions mask expressed in octal notation.
#permissions: 0600

# Set to true to log messages in json format.
#logging.json: false
32 changes: 19 additions & 13 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,48 +107,54 @@ 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`

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
The permissions mask to apply when rotating log files. The default value is 0600. The
`permissions` option must be a valid Unix-style file permissions mask expressed
in octal notation. In Go, numbers in octal notation must start with '0'.

Examples:

* 0644: give read and write access to the file owner, and read access to all others.
* 0600: give read and write access to the file owner, and no access to all others.
* 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
4 changes: 4 additions & 0 deletions metricbeat/metricbeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1167,5 +1167,9 @@ logging.files:
# Number of rotated log files to keep. Oldest files will be deleted first.
#keepfiles: 7

# The permissions mask to apply when rotating log files. The default value is 0600.
# Must be a valid Unix-style file permissions mask expressed in octal notation.
#permissions: 0600

# Set to true to log messages in json format.
#logging.json: false
4 changes: 4 additions & 0 deletions packetbeat/packetbeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1199,5 +1199,9 @@ logging.files:
# Number of rotated log files to keep. Oldest files will be deleted first.
#keepfiles: 7

# The permissions mask to apply when rotating log files. The default value is 0600.
# Must be a valid Unix-style file permissions mask expressed in octal notation.
#permissions: 0600

# Set to true to log messages in json format.
#logging.json: false
4 changes: 4 additions & 0 deletions winlogbeat/winlogbeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -776,5 +776,9 @@ logging.files:
# Number of rotated log files to keep. Oldest files will be deleted first.
#keepfiles: 7

# The permissions mask to apply when rotating log files. The default value is 0600.
# Must be a valid Unix-style file permissions mask expressed in octal notation.
#permissions: 0600

# Set to true to log messages in json format.
#logging.json: false

0 comments on commit ae1e6d9

Please sign in to comment.