LoginSignup
5

More than 5 years have passed since last update.

Zend\Log\LoggerでZend\DI環境で使う設定

Last updated at Posted at 2014-06-19

module.config.phpやglobal.phpでの指定
※ファイルに書き出す場合

config/autload/global.php
return array(
    'di' => array(
        'instance' => array(
            'preferences' => array(
                'Zend\\Log\\LoggerInterface' => 'Zend\\Log\\Logger',
            ),
            'Zend\\Log\\Logger' => array(
                'parameters' => array(
                    'options' => array(
                        'writers' => array(
                            array(
                                'name' => 'stream',
                                'options' => array(
                                    'stream' => '/path/to/logfile'
                                ),
                            ),
                        ),
                    ),
                ),
            ),
        ),
    ),
);

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5