From a39e62174d50de4145c7afb5a4317425f042108d Mon Sep 17 00:00:00 2001 From: DeDe Morton Date: Fri, 30 Nov 2018 10:26:10 -0800 Subject: [PATCH] [Docs] Add info about accessing logs in serverless environments (#9241) --- libbeat/docs/loggingconfig.asciidoc | 57 ++++++++++++++++++++++++----- 1 file changed, 48 insertions(+), 9 deletions(-) diff --git a/libbeat/docs/loggingconfig.asciidoc b/libbeat/docs/loggingconfig.asciidoc index db34c284a8da..e0e87f66296d 100644 --- a/libbeat/docs/loggingconfig.asciidoc +++ b/libbeat/docs/loggingconfig.asciidoc @@ -14,12 +14,13 @@ == 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: @@ -27,11 +28,32 @@ logging.files: 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 <>. +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 @@ -39,6 +61,7 @@ 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: +ifndef::serverless[] [float] ==== `logging.to_syslog` @@ -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 <> to `error` and there are no errors, there will be no log file in the directory specified for logs. +endif::serverless[] [float] [[level]] @@ -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` @@ -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` @@ -163,12 +189,25 @@ 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[] + +When true, diagnostic messages printed to {beatname_uc}'s standard error output +will also be logged to the log file. This can be helpful in situations were +{beatname_uc} terminates unexpectedly because an error has been detected by +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