pub struct Builder { /* private fields */ }
Expand description
Builds the Redis logger.
Implementations§
Source§impl Builder
impl Builder
Sourcepub fn new(app_name: &str) -> Builder
pub fn new(app_name: &str) -> Builder
Creates the builder taking an application name that will end up in the @fields.application
JSON field of the structured log message.
Sourcepub fn redis(self, host: String, port: u32, key: impl Into<String>) -> Builder
pub fn redis(self, host: String, port: u32, key: impl Into<String>) -> Builder
Sets the redis details all at once.
Sourcepub fn redis_key(self, key: impl Into<String>) -> Builder
pub fn redis_key(self, key: impl Into<String>) -> Builder
Sets the name of the key for the list where log messages will be added.
Sourcepub fn redis_host(self, host: impl Into<String>) -> Builder
pub fn redis_host(self, host: impl Into<String>) -> Builder
Sets the name of the redis host. Defaults to ‘localhost’.
Sourcepub fn redis_port(self, val: u32) -> Builder
pub fn redis_port(self, val: u32) -> Builder
Sets the name of the redis port. Defaults to 6379.
Sourcepub fn ttl(self, duration: Duration) -> Builder
pub fn ttl(self, duration: Duration) -> Builder
Sets the time to live for messages in the redis list. Defaults to no timeout
Sourcepub fn source_host(self, host: impl Into<String>) -> Builder
pub fn source_host(self, host: impl Into<String>) -> Builder
Sets the name noted down in logs indicating the source of the log entry i.e. the
@source_host
field in the JSON payload
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Builder
impl RefUnwindSafe for Builder
impl Send for Builder
impl Sync for Builder
impl Unpin for Builder
impl UnwindSafe for Builder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more