I trying to write custom appender for logging in NLog. I saw some examlpes for log4net where should write appender which is inherit from abstract class AppenderSkeleton. Can anyone name the analog class in NLog?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
NLog analog of log4net’s appenders will be target. For creating your own target, you have to inherit from
NLog.Targets.TargetWithLayout. Also you should mark your target class with attributeTargetAttribute:Next step is adding assembly where your class is defined to NLog extensions:
And last step – registering your target (NLog will search in extensions for types market by
TargetAttribute)