Skip to content

Commit

Permalink
[Docs] Add info about accessing logs in serverless environments (#9241)
Browse files Browse the repository at this point in the history
  • Loading branch information
dedemorton authored Nov 30, 2018
1 parent 41f87a4 commit d275f00
Showing 1 changed file with 38 additions and 9 deletions.
47 changes: 38 additions & 9 deletions libbeat/docs/loggingconfig.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,31 +14,54 @@
== Configure logging

The `logging` section of the +{beatname_lc}.yml+ config file contains options
for configuring the logging output. The logging system can write logs to
the syslog or rotate log files. If logging is not explicitly configured the file
output is used.
for configuring the logging output.
ifndef::serverless[]
The logging system can write logs to the syslog or rotate log files. If logging
is not explicitly configured the file output is used.

["source","yaml",subs="attributes"]
--------------------------------------------------------------------------------
----
logging.level: info
logging.to_files: true
logging.files:
path: /var/log/{beatname_lc}
name: {beatname_lc}
keepfiles: 7
permissions: 0644
--------------------------------------------------------------------------------
----

TIP: In addition to setting logging options in the config file, you can modify
the logging output configuration from the command line. See
<<command-line-options>>.
endif::serverless[]

ifdef::serverless[]
For example, the following options configure {beatname_uc} to log all the debug
messages related to event publishing:

["source","yaml",subs="attributes"]
----
logging.level: debug
logging.selectors: ["publish"]
----

The logs generated by {beatname_uc} are written to the CloudWatch log group for
the function running on Amazon Web Services (AWS). To view the logs, go to the
the monitoring area of the AWS Lambda console and view the CloudWatch log group
for the function.

// TODO: When we add support for other cloud providers, we will need to modify
// this statement and possibly have a different attribute for each provider to
// show the correct text.
endif::serverless[]

[float]
=== Configuration options

You can specify the following options in the `logging` section of the
+{beatname_lc}.yml+ config file:

ifndef::serverless[]
[float]
==== `logging.to_syslog`

Expand All @@ -60,6 +83,7 @@ rotated when the log file size limit is reached.
NOTE: {beatname_uc} only creates a log file if there is logging output. For
example, if you set the log <<level,`level`>> to `error` and there are no
errors, there will be no log file in the directory specified for logs.
endif::serverless[]

[float]
[[level]]
Expand Down Expand Up @@ -88,9 +112,11 @@ published. Also logs any warnings, errors, or critical errors.

The list of debugging-only selector tags used by different {beatname_uc} components.
Use `*` to enable debug output for all components. For example add `publish` to display
all the debug messages related to event publishing. When starting {beatname_lc},
selectors can be overwritten using the `-d` command line option (`-d` also sets
the debug log level).
all the debug messages related to event publishing.
ifndef::serverless[]
When starting {beatname_lc}, selectors can be overwritten using the `-d` command
line option (`-d` also sets the debug log level).
endif::serverless[]

[float]
==== `logging.metrics.enabled`
Expand All @@ -110,12 +136,12 @@ Here is an example log line:
Note that we currently offer no backwards compatible guarantees for the internal
metrics and for this reason they are also not documented.


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

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

ifndef::serverless[]
[float]
==== `logging.files.path`

Expand Down Expand Up @@ -163,12 +189,14 @@ Intervals must be at least 1s. Values of 1m, 1h, 24h, 7*24h, 30*24h, and 365*24h
are boundary-aligned with minutes, hours, days, weeks, months, and years as
reported by the local system clock. All other intervals are calculated from the
unix epoch. Defaults to disabled.
endif::serverless[]

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

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

ifndef::serverless[]
[float]
==== `logging.files.redirect_stderr` experimental[]

Expand All @@ -178,6 +206,7 @@ will also be logged to the log file. This can be helpful in situations were
Go's runtime but diagnostic information is not present in the log file.
This feature is only available when logging to files (`logging.to_files` is true).
Disabled by default.
endif::serverless[]

[float]
=== Logging format
Expand Down

0 comments on commit d275f00

Please sign in to comment.