実稼働環境でカスタムチャネルを印刷しようとしています。これはdev環境でうまく動作します。私はいつでもエラーではなくログに記録します。symfony 2.7のカスタムロガーチャネルが本番環境で印刷されない
以下生産のための私の設定です:
monolog:
channels: ["always"]
handlers:
main:
type: fingers_crossed
action_level: error
handler: nested
channels: ["!always"]
nested:
type: stream
path: "%kernel.logs_dir%/%kernel.environment%.log"
level: debug
console:
type: console
always:
type: stream
path: "%kernel.logs_dir%/%kernel.environment%.log"
level: debug
channels: ['always']
これは、開発のための私の設定です:ここ
monolog:
channels: ["always"]
handlers:
main:
type: stream
path: "%kernel.logs_dir%/%kernel.environment%.log"
level: debug
channels: ["!always"]
console:
type: console
bubble: false
verbosity_levels:
VERBOSITY_VERBOSE: INFO
VERBOSITY_VERY_VERBOSE: DEBUG
channels: ["!doctrine"]
console_very_verbose:
type: console
bubble: false
verbosity_levels:
VERBOSITY_VERBOSE: NOTICE
VERBOSITY_VERY_VERBOSE: NOTICE
VERBOSITY_DEBUG: DEBUG
channels: ["doctrine"]
always:
type: stream
path: "%kernel.logs_dir%/%kernel.environment%.log"
level: debug
channels: always
は、ログからの例です:
[2017-01-23 14:17:39] always.INFO: STAR REMOTE CONTROL FROM DEFAULT CONTROLLER [] []
ここでは、私はそれをどう呼びますか:
/**
* @param Request $request
* @return Response
* @throws \Exception
* @Route("/star-remote-control")
*
*/
public function starRemoteControlAction(Request $request)
{
$this->container->get('monolog.logger.always')->info('STAR REMOTE CONTROL FROM DEFAULT CONTROLLER');
...
なぜそれがprod.logに表示されないのかをトラブルシューティングできますか?
ありがとうございましたが、リンクが動作しません。 – ScottGutman
@ScottGutmanはリンクを固定しました – lordrhodos