doz59484 2015-11-16 09:38
浏览 68
已采纳

在Symfony2 prod环境中的页面上打印错误日志消息

I am currently working on a Symfony2 project and as I go through to debug I get the occasional 500 error in my dev environment, which is fine as it tells me exactly the issue.

For the prod environment, I have created several error templates so that the end user has a nicer interface when encountering errors like this, just in case I've missed something (since the dev environment is not accessible on my live server it's only the logs that help me).

However, if possible, I'd like to display part of the error log on the screen so if a client encounters a 500 error, they can recite the error to the development team. What I'm asking is, is there a way to echo a line in the error prod.log to the screen via the twig template?

Thank you Michael

  • 写回答

1条回答 默认 最新

  • down101102 2015-11-16 09:45
    关注

    It's not really mentioned anywhere (except for the source code), you should be getting the full exception message using exception.message variable.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 关于#Java#的问题,如何解决?
  • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
  • ¥15 想问一下树莓派接上显示屏后出现如图所示画面,是什么问题导致的
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化