Reputation: 1
I am trying to print custom level logs in my application using log4net. I need to create my own levels like ApplicationName.Info
, ApplicationName.Error
I don't know how to create custom levels for all default levels can anyone help me?
Upvotes: 0
Views: 418
Reputation: 5647
You seem to be doing this for the wrong reasons. Quoting log4j docs' faq:
It is possible, but rarely appropriate. [..]
It's absolutely overkill and needless work to override the already existing log-levels with custom ones. Log frameworks generally allow configuring templates according to your needs.
Use the existing levels instead, anything else is probably not the correct approach to your current problem.
Upvotes: 1