Over the years I’ve Googled and Googled for a solution to this. Heck I even tried Bing! Finally time + an urgent need permitted figuring out a simple solution. To filter down to one thread using Notepad++:
- Copy the angle brackets and thread number to clipboard. E.g. “[12]”
- Menu -> TextFX Viz -> Hide Lines without (Clipboard) text
- Press Ctrl-A (Select all text)
- Menu -> TextFX Viz -> Delete Invisible Selection
- Press Ctrl-A (Select all text)
- Menu -> TextFX Edit -> Delete Blank Lines
- That’s it! You are now viewing one logging from only one Thread
This works very quickly even with 70,000+ line 10MByte log files. IMO it avoids the need for xml log4net logging and Chainsaw (or similar).Simpler is always better.
Demo: Two threads counting to 100:
Copy the angle brackets and thread number to clipboard. E.g. “[12]”
Menu -> TextFX Viz -> Hide Lines without (Clipboard) text
Press Ctrl-A (Select all text)
Menu -> TextFX Viz -> Delete Invisible Selection
Press Ctrl-A (Select all text)
Menu -> TextFX Edit -> Delete Blank Lines
That’s it! You are now viewing one logging from only one Thread





Nice solution, needed for jboss-logging and works great!
Thank You.
It looks, nice, now I think log4j and log4net allows to log to an ODBC data source, I guess you can insert into a database and then use some kind of select to filter that data. I am in favor of logging everyhing on a development phase.
Jorge, the main issues with logging to a DB are performance and another point of failure. If connection to the database is lost where is that logged
Also I’ve seen simple systems virtually crippled and the issue turning out to be log4net -> DB logging. Rolling files are reliable and work fast but bring other issues such as filtering by thread and being distributed across the farm. As normal it’s pros and cons, it depends what’s important to your project. Performance normally wins on my projects but I tend to work on larger systems. We have up to three million devices sending data to my current system (one of HP’s mission critical services) so it has to work fast and be fault tolerant. SQL Queries of log files would be great though… there are ways to do it if you configure log4net/log4j to log in xml format but in general support staff (and myself!) don’t like the xml files. Plain text is easy to bring up in Notepad++, now we’ve learned to filter our biggest problem is gone
http://logging.apache.org/log4net/release/sdk/log4net.Appender.AdoNetAppender.html
I found, you dont need to log to odbc but using ado.net itself to a backend database, I still like the idea of logging to a databse, may be by QA team, but I will be surprise of QA shows that level of sophistication. I see your point to many many users logging to a centralize database can cripple it, but may be by QA ( a smart QA team) and some users will be ok.
Paul,
I was rebuilding my computer the other day and when I tried to download and install Notepad++, I got a virus warning. I thought there might be some mistake, so I tried to download it again. This time, our firewall blocked it as a trojan.
I hope it’s going to be fixed, because I rely on Notepad++ for a lot of things.
good tip – Notepad++ really is a joy.. one of my essential tools.