LoginSignup
0
0

More than 3 years have passed since last update.

[ECCUBE4]ログフォーマットの変更(monolog,formatter)

Last updated at Posted at 2021-04-30

環境

項目
ECCUBEバージョン 4.0.5

結論

<ECCUBEルート>/app/config/eccube/services.yaml内の定義eccube.log.formatter.lineargumentsの値を変更します。

app/config/eccube/services.yaml
    eccube.log.formatter.line:
        class: Monolog\Formatter\LineFormatter
        arguments:
            - "[%%datetime%%] %%channel%%.%%level_name%% [%%extra.session_id%%] [%%extra.uid%%] [%%extra.user_id%%] [%%extra.class%%:%%extra.function%%:%%extra.line%%] - %%message%% %%context%% [%%extra.http_method%%, %%extra.url%%, %%extra.ip%%, %%extra.referrer%%, %%extra.user_agent%%]\n"

備考

ログの設定(出力先、ファイル名、フォーマット、ローテーション定義等)は、実行モード(開発or本番)ごとに用意されていて、この中のformatterで上記の定義が指定されています。

<ECCUBEルート>/app/config/eccube/packages/dev/monolog.yml
<ECCUBEルート>/app/config/eccube/packages/prod/monolog.yml
0
0
0

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
0
0