问题
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?
回答1:
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).
来源:https://stackoverflow.com/questions/52844076/c-sharp-log4net-not-logging-line-number-of-exception