Skip to content
floriansemm edited this page Jun 22, 2012 · 4 revisions

Some sample configs for avaiable appenders. All configs placed in app/config/config.yml

Simple File Logging

file: 
  class: LoggerAppenderFile
  layout: 
    class: LoggerLayoutPattern
  params:
    file: %kernel.root_dir%/logs/default.log
    append: true

file

The log file

append (bool)

Overwrite or append content. Is no value set for append, then it is true.

Rolling File Logging

Extends the simple file appender.

rolling: 
  class: LoggerAppenderRollingFile
  layout: 
    class: LoggerLayoutPattern
  params:
    file: %kernel.root_dir%/logs/rolling.log
    append: true
    MaxFileSize: 1000
    MaxBackupIndex: 3

According to the config, the logger creates files like

  • rolling.log
  • rolling.log.1
  • rolling.log.2
  • rolling.log.3

file

See Simple File logging

append

See Simple File logging

MaxFileSize

1000 without a prefix means 1000 Bytes. Possible prefixes are:

  • KB
  • MB
  • GB

MaxBackupIndex

How many backup files

Clone this wiki locally