首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >monolog发送旧日志

monolog发送旧日志
EN

Stack Overflow用户
提问于 2018-09-06 17:23:04
回答 1查看 173关注 0票数 7

我们有web-app,用symfony-flex构建。对于部署,我使用capistrano。为了记录关键日志,我以这种方式配置了monolog:

代码语言:javascript
复制
monolog:
    handlers:
        main:
            type: fingers_crossed
            action_level: error
            channels: ['!translation']
            excluded_http_codes: [{ 404: ['^/security/login'] }]
            handler: grouped
        grouped:
            type: group
            members: [deduplicated]
        deduplicated:
            type:    deduplication
            handler: swift
        swift:
            type:       swift_mailer
            from_email: '%mailer_user%'
            to_email:   ['email1@gmail.com', 'email2@gmail.com']
            subject:    " %%level_name%% %%level%%"
            level:      info
            formatter:  monolog.formatter.html
            content_type: text/html

SwiftMailer配置:

代码语言:javascript
复制
swiftmailer:
    url: '%env(MAILER_URL)%'
    spool: { type: 'memory' }

在每次发布后,除了日志之外,所有的工作都很好。我正在获取以前发送过的旧日志。示例:

也许我在配置中遗漏了什么?

EN

回答 1

Stack Overflow用户

发布于 2019-09-14 07:48:50

deduplication处理程序类型的MonologBundle配置具有额外的潜在参数-包括

store:应保存重复数据删除日志的文件/路径,默认为%kernel.cache_dir%/monolog_dedup_*

它正在重新读取部署之前缓存目录中的文件。

我也使用Capistrano部署我的站点--但是我不会,而不是在我的站点的不同部署之间共享缓存目录。我对共享文件的配置是set :linked_dirs, [fetch(:log_path)] -只共享日志,以便长期更新它们。缓存目录仍然在./var/cache中,但它是在每次部署时新创建的。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/52200810

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档