c#log4net不记录异常的行号 [英] c# log4net not logging line number of exception

查看:39
本文介绍了c#log4net不记录异常的行号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的本地代码库中,我的日志文件记录了发生异常的确切行号.但是,我的老板只是从客户端向我发送了一个日志文件,并且我在日志中看不到任何行号.是否缺少我要记录已部署应用程序的行号的设置?

In my local code base, my log file logs the exact line number where the exception took place. However, my boss just sent me a log file from a client, and I don't see a single line number in the log. Is there a setting I am missing to log the line number for a deployed application?

推荐答案

如果要在记录的堆栈跟踪中显示行号,则必须部署匹配的 .pdb 文件.即使这样,如果启用了 Optimize code (建议用于产品版本)进行编译,则行号可能与源代码不匹配.

If you want line numbers in your logged stack trace you have to deploy the matching .pdb files. Even then the line numbers might not match the source code if you compiled with Optimize code enabled (recommended for prod builds).

这篇关于c#log4net不记录异常的行号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆