LogEntityDefaultFile
From MARIEWiki
[edit]
Description
This LogEntity specialized the LogEntityDataFactory and use a FileAppender and a mariePattern layout.
[edit]
Configuration
Note : see Configuration Description Language for syntax details.
! T logEntity # KV name # KV type = LogEntityDefaultFile # KV filename o KV protocolID o KV minlevel o KV conversionPattern o KV createDirectory o KV preserveExistingFile
- name : Specify a name for the logEntity create. This name is also used for the name of log4cxx logger create.
- type : Specify the type of logEntity used : LogEntityDataFactory
- filename : Specify the filename where the log must be journalize.
- protocolID : Specify the protocol desired when you log DataAbstract : MARIETAB,MARIEPRETTY,MARIEXML. (MARIETAB by default)
- minlevel : Specify the level minimum wanted to journalize your log : all, debug, info, warn, error, fatal. (warn by default)
- conversionPattern : Structure of the log, used a mariePattern ([%T] [%-5p] [%c] %15d{%X.%Q} | %m%n by default) (see: pattern)
- createDirectory : If true, the logger create the directory specified in filename, otherwise not. (false by default)
- preserveExistingFile : If true, the logger check if the file exist. If yes, the filename will be completed by "_XX" where XX correspond to the number of file with the same filename. Otherwise, the file will be truncated before being opened. (true by default)
[edit]
Example
<logEntity elem="type">
<name elem="kv">MyLogEntity</name>
<type elem="kv">LogEntityDefaultFile</type>
<protocolID elem="kv">MARIEPRETTY</protocolID>
<minLevel elem="kv">info</minLevel>
<filename elem="kv">./log/info/ComponentInfo.txt</filename>
<conversionPattern elem="kv">[%20T] [%T] [%m] [%m]%n</conversionPattern>
<createDirectory elem="kv">true</createDirectory>
<preserveExistingFile elem="kv">false</preserveExistingFile>
</logEntity>

