symfony API

sfFileLogger Class

You are currently browsing
the website for symfony 1

Visit the Symfony2 website

« Back to API menu


You are currently browsing the symfony API for the 1.4 version. Switch to:
This version of symfony is not maintained anymore.
If some of your projects still use this version, consider upgrading as soon as possible.

sfFileLogger logs messages in a file.


sfFileLogger  <  sfLogger

Method Summary

  • doLog($message, $priority)
    Logs a message.
  • string getPriority($priority)
    Returns the priority string to use in log messages.
  • Boolean initialize($dispatcher, $options)
    Initializes this logger.
  • shutdown()
    Executes the shutdown method.

Methods inherited from sfLogger

alert , crit , debug , doLog , emerg , err , getLogLevel , getOptions , getPriorityName , info , initialize , listenToLogEvent , log , notice , setLogLevel , setOption , shutdown , warning , __construct

Method Details

  • doLog ($message, $priority)

    $message Message
    $priority Message priority

    Logs a message.

  • (string) getPriority ($priority)

    $priority The priority constant

    Returns the priority string to use in log messages.

    returns The priority to use in log messages

  • (Boolean) initialize ($dispatcher, $options)

    $dispatcher A sfEventDispatcher instance
    $options An array of options.

    Initializes this logger.

    Available options:

    - file: The file path or a php wrapper to log messages
    You can use any support php wrapper. To write logs to the Apache error log, use php://stderr
    - format: The log line format (default to %time% %type% [%priority%] %message%%EOL%)
    - time_format: The log time strftime format (default to %b %d %H:%M:%S)
    - dir_mode: The mode to use when creating a directory (default to 0777)
    - file_mode: The mode to use when creating a file (default to 0666)

    returns true, if initialization completes successfully, otherwise false.

  • shutdown ()

    Executes the shutdown method.