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 can I filter certain messages in log4net

How can I filter certain messages in log4net

Scheduled Pinned Locked Moved C#
question
5 Posts 4 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.
  • B Offline
    B Offline
    Berlus
    wrote on last edited by
    #1

    Hello, I'm using a 3rd party that uses log4net in order to log its messages. I'm interested only on those messages that do not include "UnwantedTextExample". How can I configure the config.log4net in order to not log those messages? Thanks, Berlus

    F M P 3 Replies Last reply
    0
    • B Berlus

      Hello, I'm using a 3rd party that uses log4net in order to log its messages. I'm interested only on those messages that do not include "UnwantedTextExample". How can I configure the config.log4net in order to not log those messages? Thanks, Berlus

      F Offline
      F Offline
      fjdiewornncalwe
      wrote on last edited by
      #2

      I work with some legacy applications that still log to flat file with log4net as well. As I can't change the logging from the source side, I have resorted to opening the logs in Excel(as ours are comma delimited) and then I simply use the data processing features (Sorting and Filter) to find the entries I'm interested in. It can be quite frustrating, I know, but that's why we've been converting everything to use database error logging instead.

      I wasn't, now I am, then I won't be anymore.

      1 Reply Last reply
      0
      • B Berlus

        Hello, I'm using a 3rd party that uses log4net in order to log its messages. I'm interested only on those messages that do not include "UnwantedTextExample". How can I configure the config.log4net in order to not log those messages? Thanks, Berlus

        M Offline
        M Offline
        Manfred Rudolf Bihy
        wrote on last edited by
        #3

        For logfile analysis you might want to try Chainsaw Read here: http://www.google.com/search?sitesearch=*.apache.org&q=loggin#sclient=psy&hl=de&sitesearch=*.apache.org&q=logging+log4net+analysis+chainsaw Best Regards, Manfred

        B 1 Reply Last reply
        0
        • M Manfred Rudolf Bihy

          For logfile analysis you might want to try Chainsaw Read here: http://www.google.com/search?sitesearch=*.apache.org&q=loggin#sclient=psy&hl=de&sitesearch=*.apache.org&q=logging+log4net+analysis+chainsaw Best Regards, Manfred

          B Offline
          B Offline
          Berlus
          wrote on last edited by
          #4

          I am afraid i didn't make myself clear. I'm trying to filter the log messages ONLINE, not after the program has ended. I'm trying to reduce the size of the log files that get created each run. thanks, Belrus

          1 Reply Last reply
          0
          • B Berlus

            Hello, I'm using a 3rd party that uses log4net in order to log its messages. I'm interested only on those messages that do not include "UnwantedTextExample". How can I configure the config.log4net in order to not log those messages? Thanks, Berlus

            P Offline
            P Offline
            Pete OHanlon
            wrote on last edited by
            #5

            One of the key features of log4net is that you are able to configure it to use any log appender - even one you have written yourself. It should be fairly simple to write your own appender that uses discards these entries, and use this just by adding the appropriate configuration entries. I demonstrate a custom appender in this[^] blog entry.

            I'm not a stalker, I just know things. Oh by the way, you're out of milk.

            Forgive your enemies - it messes with their heads

            My blog | My articles | MoXAML PowerToys | Onyx

            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