how to use two appender based on the type in log4net
-
hi. friends small clarification in log4net. i am new to log4net so any mistake correct me. i have small program that uses log4net, and i have two appenders like 1.LogFileAppender (writes log to file) 2.ADONetAppender (writes log to DB) then i have <root> <level value="DEBUG" /> <appender-ref ref="LogFileAppender" /> <appender-ref ref="ADONetAppender" /> </root> when i use this config..my logs written in both my question are 1. what is that "level value="DEBUG" or INFO " what dose it do and what is the different?? 2. i have to write my write debug and info log to my log file and other error,fatal & warning logs to db how can i do that?? any idia of like??? thanks joe
-
hi. friends small clarification in log4net. i am new to log4net so any mistake correct me. i have small program that uses log4net, and i have two appenders like 1.LogFileAppender (writes log to file) 2.ADONetAppender (writes log to DB) then i have <root> <level value="DEBUG" /> <appender-ref ref="LogFileAppender" /> <appender-ref ref="ADONetAppender" /> </root> when i use this config..my logs written in both my question are 1. what is that "level value="DEBUG" or INFO " what dose it do and what is the different?? 2. i have to write my write debug and info log to my log file and other error,fatal & warning logs to db how can i do that?? any idia of like??? thanks joe
hi friends i found the answer 1. it is to set the level like(debu,Info,Warn,Error,fatal) 2.it is possible by setting (use any one of this code in said the specific appender) this will set the top level <threshold value="DEBUG"/> this will filter the level <filter type="log4net.Filter.LevelRangeFilter"> <levelMin value="DEBUG" /> <levelMax value="WARN" /> </filter> Thanks