[ECCUBE4]ログフォーマットの変更(monolog,formatter)
環境
項目 | 値 |
---|---|
ECCUBEバージョン | 4.0.5 |
結論
<ECCUBEルート>/app/config/eccube/services.yaml
内の定義eccube.log.formatter.line
のarguments
の値を変更します。
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
Author And Source
この問題について([ECCUBE4]ログフォーマットの変更(monolog,formatter)), 我々は、より多くの情報をここで見つけました https://qiita.com/s-katsumata/items/406f02ae9f38257ff55b著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .