This logger send information into a file.
See Service Configuration for detailled information to configure your service. You must declare this logger with the <logger> section inside the <loggers> section. It will looks like :
<logger name="MyLoggerName" type="LeCouteauSuisse.Components.FileLogger,
LeCouteauSuisseComponents, Version=1.0.0.2, Culture=neutral, PublicKeyToken=8d1037c5df6d5bd0">
This component have some parameters inside the section <settings>. Each parameter is written with a <setting> section.
Key name | Mandatory | Default value | Description |
filenameFormat | No | Value from the Path.GetTempFileName() method of the Framework. | The name of the file. You can format the filename with the current date and time. Example : "c:\Temp\FileLogger{0:yyyyMMdd}.txt" will generate a log file each day |
lineFormat | No | {0:dd/MM/yyyy HH:mm:ss} [{1}] : [Level={2}] [MessageId={3:d}] [Category={4:d}] : {5}\n | The format of a message to write. |
lineFormatException | No | {0:dd/MM/yyyy HH:mm:ss} [{1}] : [Level={2}] [MessageId={3:d}] [Category={4:d}] : {5}\nError : {6}\n | The format of a message with an error to write. |
filterLevel | No | All | Filter message to log by level. List of value from the LoggerLevel enumeration separated by a comma. |
Format of a line
Six or Seven parameters are available when you format a line. These parameters are :
- Current date and time
- Thread identifier
- Level of message
- The message identifier
- The message category
- The message
- The error description when message has errors