Class LogStream
Namespace: Sisk.Core.Http
Assembly: Sisk.Core.dll
Provides a managed, asynchronous log writer which supports writing safe data to log files or text streams.
public class LogStream : IDisposable, IAsyncDisposable
Inheritance
Derived
Implements
Inherited Members
object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Constructors
Creates an new LogStream instance with no predefined outputs.
Creates an new LogStream instance with the given TextWriter object.
Creates an new LogStream instance with the given relative or absolute file path.
LogStream(string?, TextWriter?)
Creates an new LogStream instance which writes text to an file and an TextWriter.
Properties
Gets a shared LogStream that writes its output to the Out stream.
Gets an boolean indicating if this LogStream was disposed.
Gets a shared LogStream without any output stream.
Gets or sets the encoding used for writting data to the output file. This property is only appliable if this instance is using an file-based output.
Gets or sets the absolute path to the file where the log is being written to.
Gets an boolean indicating if this LogStream is buffering output messages to their internal message buffer.
Gets or sets a boolean that indicates that every input must be trimmed and have their line endings normalized before being written to the output stream.
Gets the defined RotatingLogPolicy for this LogStream.
Gets the TextWriter object where the log is being written to.
Methods
Writes all pending logs from the queue and closes all resources used by this object.
ConfigureRotatingPolicy(long, TimeSpan)
Defines the time interval and size threshold for starting the task, and then starts the task. This method is an shortcut for calling Sisk.Core.Http.RotatingLogPolicy.Configure(System.Int64,System.TimeSpan) of this defined RotatingPolicy method.
Writes all pending logs from the queue and closes all resources used by this object.
Asynchronously writes all pending logs from the queue and closes all resources used by this object.
Blocks the current thread until all currently enqueued content is written to the underlying streams.
Asynchronously waits until all currently enqueued content is written to the underlying streams.
Reads the output buffer. To use this method, it's required to set this LogStream buffering with StartBuffering(int).
Start buffering all output to an alternate stream in memory for readability with Peek() later.
Stops buffering output.
Writes an exception description in the log.
WriteException(Exception, string?)
Writes an exception description in the log.
WriteExceptionAsync(Exception)
Writes an exception description in the log.
WriteExceptionAsync(Exception, string?)
Writes an exception description in the log.
Writes an line-break at the end of the output.
Writes the text and concats an line-break at the end into the output.
Writes the text and concats an line-break at the end into the output.
WriteLine(string, params ReadOnlySpan<object?>)
Writes the text format and arguments and concats an line-break at the end into the output.
WriteLine(string, params IEnumerable<object?>)
Writes the text format and arguments and concats an line-break at the end into the output.
WriteLine(IFormatProvider?, string, params object?[])
Writes the text format and arguments and appends a line-break at the end into the output, using the specified format provider.
Writes an line-break at the end of the output.
Writes the text and concats an line-break at the end into the output.
Writes the text and concats an line-break at the end into the output.
WriteLineAsync(string, params IEnumerable<object?>)
Writes the text format and arguments and concats an line-break at the end into the output.
WriteLineAsync(IFormatProvider?, string, params object?[])
Writes the text format and arguments and appends a line-break at the end into the output, using the specified format provider.
Represents the method that intercepts the line that will be written to an output log before being queued for writing. This method will block if the log queue is full.
WriteLineInternalAsync(string)
Represents the asynchronous method that intercepts the line that will be written to an output log before being queued for writing.
English
Русский
Português
Español
Deutsch
中文 (简体)
日本語