Struct gelf_logger::Config
source · pub struct Config { /* private fields */ }
Expand description
Struct to manipulate configuration.
Implementations§
source§impl Config
impl Config
sourcepub fn try_from_yaml(path: &str) -> Result<Config, Error>
pub fn try_from_yaml(path: &str) -> Result<Config, Error>
Load configuration using the given path
file.
§Example
use gelf_logger::Config;
let config = Config::try_from_yaml("/tmp/myconf.yml").unwrap();
sourcepub fn level(&self) -> GelfLevel
pub fn level(&self) -> GelfLevel
The threshold for this logger to level. Logging messages which are less severe than level will be ignored.
sourcepub fn null_character(&self) -> bool
pub fn null_character(&self) -> bool
Adds a NUL byte (\0
) after each entry.
sourcepub fn async_buffer_size(&self) -> Option<usize>
pub fn async_buffer_size(&self) -> Option<usize>
Get the asynchronous buffer size. This buffer is placed between the log subsystem and the network sender. This represent the maximum number of message the system will buffer before blocking while waiting for message to be actually sent to the remote server.
If None is configured, it defaults to 1000
sourcepub fn buffer_size(&self) -> Option<usize>
pub fn buffer_size(&self) -> Option<usize>
Get the upperbound limit on the number of records that can be placed in the buffer, once this size has been reached, the buffer will be sent to the remote server.
sourcepub fn buffer_duration(&self) -> Option<Duration>
pub fn buffer_duration(&self) -> Option<Duration>
Get the maximum lifetime of the buffer before send it to the remote server.
sourcepub fn additional_fields(&self) -> &BTreeMap<Value, Value>
pub fn additional_fields(&self) -> &BTreeMap<Value, Value>
Every additional data which will be append to each log entry.
sourcepub fn full_buffer_policy(&self) -> Option<FullBufferPolicy>
pub fn full_buffer_policy(&self) -> Option<FullBufferPolicy>
Get the full buffer policy
sourcepub fn write_timeout(&self) -> Option<Duration>
pub fn write_timeout(&self) -> Option<Duration>
Get the write timeout
sourcepub fn connect_timeout(&self) -> Option<Duration>
pub fn connect_timeout(&self) -> Option<Duration>
Get the connect timeout
sourcepub fn builder() -> ConfigBuilder
pub fn builder() -> ConfigBuilder
Returns a new builder.