Class FileSink
Provides a file storage destination implementation
Inheritance
System.Object
FileSink
Implements
System.IDisposable
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: Azos.Log.Sinks
Assembly: Azos.dll
Syntax
public abstract class FileSink : Sink, IDisposable, IDaemon, IDaemonView, IApplicationComponent, ILocalizedTimeProvider, IInstrumentable, IExternallyParameterized, IConfigurable, INamed, IOrdered
Constructors
FileSink(ISinkOwner)
Declaration
protected FileSink(ISinkOwner owner)
Parameters
Type | Name | Description |
---|---|---|
ISinkOwner | owner |
FileSink(ISinkOwner, String, Int32)
Declaration
protected FileSink(ISinkOwner owner, string name, int order)
Parameters
Type | Name | Description |
---|---|---|
ISinkOwner | owner | |
System.String | name | |
System.Int32 | order |
Fields
m_FileName
Declaration
protected string m_FileName
Field Value
Type | Description |
---|---|
System.String |
m_Path
Declaration
protected string m_Path
Field Value
Type | Description |
---|---|
System.String |
m_Stream
Declaration
protected FileStream m_Stream
Field Value
Type | Description |
---|---|
System.IO.FileStream |
Properties
DefaultFileName
Declaration
protected virtual string DefaultFileName { get; }
Property Value
Type | Description |
---|---|
System.String |
FileName
The name of the file without path may use {0} for date: {0:yyyyMMdd}-$($name).csv.log
Declaration
[Config]
public virtual string FileName { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Path
Directory where file should be created. Will create the directory chain if it doesn't exist
Declaration
[Config]
public virtual string Path { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Methods
DoCloseStream()
Called just before output stream is closed
Declaration
protected abstract void DoCloseStream()
DoOpenStream()
Called after output stream has been opened
Declaration
protected abstract void DoOpenStream()
DoPulse()
Declaration
protected override void DoPulse()
Overrides
DoSend(Message)
Override DoFormatMessage() instead
Declaration
protected override sealed void DoSend(Message msg)
Parameters
Type | Name | Description |
---|---|---|
Message | msg |
Overrides
DoStart()
Declaration
protected override void DoStart()
Overrides
DoWaitForCompleteStop()
Declaration
protected override void DoWaitForCompleteStop()
Overrides
DoWriteMessage(Message)
Called when message is to be written to stream
Declaration
protected abstract void DoWriteMessage(Message msg)
Parameters
Type | Name | Description |
---|---|---|
Message | msg |
GetDestinationFileName()
Declaration
protected virtual string GetDestinationFileName()
Returns
Type | Description |
---|---|
System.String |
Implements
System.IDisposable