Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
9 changes: 9 additions & 0 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ The following parameters are available in the `fluentbit` class:
* [`grace`](#-fluentbit--grace)
* [`daemon`](#-fluentbit--daemon)
* [`dns_mode`](#-fluentbit--dns_mode)
* [`log_file`](#-fluentbit--log_file)
* [`log_level`](#-fluentbit--log_level)
* [`http_server`](#-fluentbit--http_server)
* [`http_listen`](#-fluentbit--http_listen)
Expand Down Expand Up @@ -361,6 +362,14 @@ Data type: `Enum['UDP', 'TCP']`

Sets the primary transport layer protocol used by the asynchronous DNS resolver.

##### <a name="-fluentbit--log_file"></a>`log_file`

Data type: `Optional[Stdlib::Absolutepath]`

Absolute path where Fluent Bit will write its diagnostic logs.
When specified, logs go to this file instead of syslog.
The file will be created by Fluent Bit automatically.

##### <a name="-fluentbit--log_level"></a>`log_level`

Data type: `Fluentbit::Loglevel`
Expand Down
8 changes: 7 additions & 1 deletion manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,12 @@
'hc.period' => $fluentbit::hc_period,
},
}
$log_file_config = $fluentbit::log_file ? {
undef => {},
default => {
'log_file' => $fluentbit::log_file,
},
}

$service_config = {
'flush' => $fluentbit::flush,
Expand All @@ -146,7 +152,7 @@
'scheduler.cap' => $fluentbit::scheduler_cap,
'scheduler.base' => $fluentbit::scheduler_base,
'json.convert_nan_to_null' => $fluentbit::json_convert_nan_to_null,
} + $storage_config + $health_config
} + $storage_config + $health_config + $log_file_config

if $fluentbit::format == 'classic' {
$config_content = epp('fluentbit/fluentbit.conf.epp',
Expand Down
5 changes: 4 additions & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,11 @@
# Boolean value to set if Fluent Bit should run as a Daemon (background) or not. Allowed values are: yes, no, on and off.
# @param dns_mode
# Sets the primary transport layer protocol used by the asynchronous DNS resolver.
# @param log_file
# Specify the absolute path to the log file for Fuent Bit service itself
# @param log_level
# Set the logging verbosity level.
# Values are: error, info, debug and trace. Values are accumulative,
# Values are: off, error, warn, info, debug and trace. Values are accumulative,
# e.g: if 'debug' is set, it will include error, info and debug.
# Note that trace mode is only available if Fluent Bit was built with the WITH_TRACE option enabled.
# @param http_server
Expand Down Expand Up @@ -298,6 +300,7 @@
Fluentbit::Stream $streams = {},
Array[Stdlib::Absolutepath] $plugins = [],
Optional[String[1]] $memory_max = undef,
Optional[Stdlib::Absolutepath] $log_file = undef,
Array[Stdlib::Absolutepath] $includes = [],
) {
$pipelines_path = "${config_dir}/${pipelines_dir}"
Expand Down
3 changes: 3 additions & 0 deletions templates/fluentbit.conf.epp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
Grace <%= $service['grace'] %>
dns.mode <%= $service['dns.mode'] %>
Log_Level <%= $service['log_level'] %>
<% if $service['log_file'] { %>
Log_File <%= $service['log_file'] %>
<% } -%>
parsers_file <%= $service['parsers_file'] %>
plugins_file <%= $service['plugins_file'] %>
streams_file <%= $service['streams_file'] %>
Expand Down
2 changes: 1 addition & 1 deletion types/loglevel.pp
Original file line number Diff line number Diff line change
@@ -1 +1 @@
type Fluentbit::Loglevel = Enum['error', 'warning', 'info', 'debug', 'trace']
type Fluentbit::Loglevel = Enum['error', 'warn', 'info', 'debug', 'trace', 'off']