Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. how to use two appender based on the type in log4net

how to use two appender based on the type in log4net

Scheduled Pinned Locked Moved C#
questiondatabasedebugginghelptutorial
2 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Joe Rozario
    wrote on last edited by
    #1

    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

    J 1 Reply Last reply
    0
    • J Joe Rozario

      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

      J Offline
      J Offline
      Joe Rozario
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups