logging

How do I detect if I'm running in the console

Is there a simple way to have a code library automatically detect if it's being called from a console application or a windows application? I'd like my library not to report to the Windows Event log if it's being called from a console window, but instead report to the console window. If however, it's not being run from within a console...

What is the point of remote events for chainsaw log4j viewer?

http://logging.apache.org/chainsaw/quicktour.html First feature. I completed the tutorial, it simply showed how to visually use the GUI, it didn't go into much detail at all regarding this new feature. The best documentation I have found is this: Just as Appenders send logging events outside of the log4j environment (to files, to s...

Firing an email when any error is logged via Enterprise Library

Hi everyone. I've got a ASP.NET website that is utilizing many aspects of the Enterprise Library (3.1), including the Logging Application Block. I'm using a custom TraceListener to handle all of the logging requests. I want to add an email listener that will fire an email whenever an error occurs in the website. To be clear (and beca...

Is there a good solution to DOM Event Logging ?

I need to create an analytics solution for a client. They have a large number of DOM manipulations through JQuery/Ajax. Besides making a call to a function for each DOM manipulation, is there any other efficient way to log DOM Events? I need to log each DOM manipulation so that we can run analytics on that data. There are many inst...

Disable logging for struts2 validation

I want to disable logging for struts2 validation,whenever a struts action called containing validation I get 'junk' in my log, smth like this : "[Apr 15 14:42:41] ERROR (CommonsLogger.java:24) - Validation error for domain:blahblah.". I'm already using log4j and it's logging just fine but I don't want to this 'junk' filling my log. If ...

Asynchronous Logging To A Database .Net

Hi, i Was wondering what people are using for logging in .net. We have log4net here, but am looking to do it async and to a database with a nice viewer. What are the popular choices?? Regards. ...

Where can I write my log4net log file to under ClickOnce?

When I run my application locally it writes my log4net log to the location I've configured (i.e., <file value="${LOCALAPPDATA}\TEST\Logs\debug.log" />) without a problem. However, when I deploy my application via ClickOnce, the log file is not being written. I know ClickOnce applications are limited in terms of where they can write t...

Fast Search in Logs

I have the same problem as somebody described in another post. My application's log files are huge (~1GB), and grep is tedious to use to correlate information from the log files. Right now I use the ''less'' tool, but it is also slower than I would like. I am thinking of speeding up the search. There are the following ways to do this: ...

Where to put auditing or logging?

I'm currently working on an ASP.NET MVC project using NHibernate and I need to keep track of changes on some entities in order to be able to make some reports and queries over the data. For this reason I wanted to have the data in a table, but I'm trying to decide where to "hook" the auditing code. On the NHibernate layer: PRO: Powerf...

How to track down log4net problems

I use log4net all the time, but one thing I've never figured out is how to tell what's going on on the inside. For example, I've got a console appender and a database appender in my project. I made a few changes to the database and the code, and now the database appender doesn't work anymore. I'll figure out why eventually, but it would ...

Grouping log4net errors by similarity

We use log4net for logging application exceptions for a variety of web applications. At present we use the RollingLogFileAppender with a threshold of Info and SmtpAppender with a threshold of Warn. The problem is that we have no easy way of grouping error log entries by their contents. There are certain errors that we see frequently, an...

Implementing a no-op std::ostream

Hi, I'm looking at making a logging class which has members like Info, Error etc that can configurably output to console, file, or to nowhere. For efficiency, I would like to avoid the overhead of formatting messages that are going to be thrown away (ie info messages when not running in a verbose mode). If I implement a custom std::st...

nHibernate logging during unit testings

I'm running unit tests from inside VS2008 against a nHibernate application and would like to turn on logging during the unit tests so I can see a bit more of what is going on. I've copied and pasted another application's app.config that successfully logs nhibernate information into the unit tests app.config, but still don't get any outp...

Block 404 FavIco error in ELMAh

I noticed out of the box that ELMAH logs a 404 not found for favico on my local server. How do I suppress this error through a filter? I'm not so familiar with configurating it yet.. ...

Inputing into other programs [C/C++]

So I have a C program that runs on the Windows Platform that periodically sends emails of log files , it is supposed to run in the background with no interference. I don't want to make the email address a constant. What are some ways to input an email address into this program? I was thinking of a simple script that just takes paramete...

Automatically Logging Exceptions in Ruby

Is there a library or easy way to catch exceptions thrown in a Ruby program and log it to a file? I've looked over log4r and logger, but the docs on both don't provide any examples on how I would do this. I run this program remotely and lose handles to stdout and stderr, if that information helps at all. What would you recommend? ...

How to get ELMAH to work with ASP.NET MVC [HandleError] attribute?

I am trying to use ELMAH to log errors in my ASP.NET MVC application, however when I use the [HandleError] attribute on my controllers ELMAH doesn't log any errors when they occur. As I am guessing its because ELMAH only logs unhandled errors and the [HandleError] attribute is handling the error so thus no need to log it. How do I modi...

Maintaining a database externally in a text file

hi all, What is the simplest way of maintaining a txt based database file that allows the program the write in new or edit existing entry during execution time. to be specific, the program must be capable of storing a client, ip and port when it logs in, and remove accordingly when the client logs out, without using "internal" approac...

Adding logging to an asp.net Dynamic Data application

Hi, I am trying to find out what would be the best way to add logging to a Dynamic Data app? I am using DD for an admin interface and I need to log all the actions the user makes. I thought of adding things to the codebehind of the PageTemplates\ListDetails for example, but was wondering if there is a better way... For data access I am...

How to configure log4net programmatically from scratch (no config)

This is a Bad Idea, I know, but... I want to configure log4net programmatically from scratch with no config file. I'm working on a simple logging application for me and my team to use for a bunch of relatively small departmental applications we're responsible for. I want them to all log to the same database. The logging application is ju...