简体   繁体   中英

log4net Exception don't show class location

I'm using log for net to log exception in a database. The behavior of the logging is fine, but the inner exception has the message like:

at ...... message details ..... at C:/User/projects/projectX/classXPTO.cs:line 123

Unfortunately this exception will be monitored by a third party company, and I need to hide the class location:

C:/User/projects/projectX/classXPTO.cs

Any suggestions?

Thank you.

This is normal behaviour while running in Debug.

You have the .pdb files with the running application. The runtime looks for them when it generates a stack trace to give you as much info as possible.

If you deploy without the .pdb files, it will not show the file location.
You can also run in Release mode;

When deploying a Release build, the PDB files are omitted (unless you specify otherwise)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM