[][src]Struct tracing_appender::rolling::RollingFileAppender

pub struct RollingFileAppender { /* fields omitted */ }

A file appender with the ability to rotate log files at a fixed schedule.

RollingFileAppender implements std:io::Write trait and will block on write operations. It may be used with NonBlocking to perform writes without blocking the current thread.

Examples

let file_appender = tracing_appender::rolling::hourly("/some/directory", "prefix.log");

Implementations

impl RollingFileAppender[src]

pub fn new(
    rotation: Rotation,
    directory: impl AsRef<Path>,
    file_name_prefix: impl AsRef<Path>
) -> RollingFileAppender

Notable traits for RollingFileAppender

impl Write for RollingFileAppender
[src]

Creates a new RollingFileAppender.

A RollingFileAppender will have a fixed rotation whose frequency is defined by Rotation. The directory and file_name_prefix arguments determine the location and file name's prefix of the log file. RollingFileAppender will automatically append the current date and hour (UTC format) to the file name.

Alternatively, a RollingFileAppender can be constructed using one of the following helpers:

Examples

use tracing_appender::rolling::{RollingFileAppender, Rotation};
let file_appender = RollingFileAppender::new(Rotation::HOURLY, "/some/directory", "prefix.log");

Trait Implementations

impl Debug for RollingFileAppender[src]

impl Write for RollingFileAppender[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.