logging

C# How costly is Directory.Exists

Is it a bad idea to ensure that a log directory exists before every log message in an application that could be logging a few times a second (though not continually)? I could implement a File System Watcher style thread to fire up and recreate a lost log directory, but my gut feeling is that would be a bit heavier an operation ...

Automatic factory with Common.Logging and Autofac?

I would like to inject ILog into my classes, not an ILoggerFactoryAdapter, but the ILoggerFactoryAdapter needs the name of the calling class (the class that wants to log something, so i can be properly categorized) so can Autofac somehow identify the class which are requesting the ILog and automaticly create the ILog from the factory? ...

A method for high-load web site logging to file?

I need to build in click and conversion tracking (more specific and focused than IIS log files) to an existing web site. I am expecting pretty high load. I have investigated using log4net, specifically the FileAppender Class, but the docs explicitly state: "This type is not safe for multithreaded operations." Can someone suggest a robus...

Concurrent file write

Hi, how to write to a text file that can be accessed by multiple sources (possibly in a concurrent way) ensuring that no write operation gets lost? Like, if two different processes are writing in the same moment to the file, this can lead to problems. The simples solution (not very fast and not very elegant) would be locking the file wh...

Log to database instead of log files?

I'm interested in sending all Rails application logging to a database (MySQL or MongoDB) either in addition to or instead of to a log file. There are a few reasons, most of them surround doing things somewhat similar to Google Analytics - basically log file analysis. We already use Google Analytics, but there are a variety of things we...

Including current date in python logging file

I have a process that I run every day. It uses Python logging. How would I configure the python logging module to write to a file containing the current date in the file name? Because I restart the process every morning the TimedRotatingFileHandler won't work. The project is larger, so I would be interested in keeping the code requir...

Where are the logs for a Rails app packed using Warbler?

I'm using Warbler to pack a Rails application into a WAR. I've deployed it to a JBoss server and it seems to works. However, I'm getting the classic 500 error on Rails saying "We're sorry, but something went wrong.". Usually, I'd take a look at logs/production.log to find out what's wrong, but since the project is WARed, I can't access...

Castle Windsor: Best way to log when a component is registered?

I would like to log when a component (interface and implementation) is registered to my container. What is the best way of doing this? I found the IKernelEvents interface that looks promising but I can't find how to actually use it. ...

Web service cannot write to Event Log when called by anonymous user

SUMMARY: How to configure a web service such that writing to the Event Log is always possible (regardless of caller)? DETAILS: I have a web service which writes an entry to the Application Log. I established the event source for this by means of a little console application and I think I understand that part of things. When I test this ...

Unit Testing: Logging and Dependency Injection

So regards logging from SO and other sites on the Internet the best response seems to be: void DoSomething() { Logger.Log("Doing something!"); // Code... } Now generally you'd avoid static methods but in the case of logging (a special case) this is the easiest and cleaniest route. Within the static class you can easily inject ...

How do I get urllib2 to log ALL transferred bytes

I'm writing a web-app that uses several 3rd party web APIs, and I want to keep track of the low level request and responses for ad-hock analysis. So I'm looking for a recipe that will get Python's urllib2 to log all bytes transferred via HTTP. Maybe a sub-classed Handler? ...

How to debug/log/trace an applet loading problem?

Recently two of our clients have reported problems with our applets. Looking at the java plugin console it is full of ClassNotFoundException so none of our code is executed. I've been able to reproduce the stack trace using a virtual pc image with 0 free space on disk, but the problem goes away as I restore some disk space, and the user...

Best tool for monitoring Coldfusion interoperability with .Net web service

Is there a tool to see the message sent to webservice hosted on an IIS server? I have a webservice written in .Net and our ColdFusion people are having trouble building a "complex" parameter. This problem is described from a ColdFusion perspective at: adobe forum question It runs when called from a .net client. While hosted on a server...

What does "GC--" mean in a java garbage collection log?

We've turned on verbose GC logging to keep track of a known memory leak and got the following entries in the log: ... 3607872.687: [GC 471630K->390767K(462208K), 0.0325540 secs] 3607873.213: [GC-- 458095K->462181K(462208K), 0.2757790 secs] 3607873.488: [Full GC 462181K->382186K(462208K), 1.5346420 secs] ... I understand the first and ...

How do I find if it is the last line while reading a file from within a loop in perl

I am working on a log parsing script using Perl. I am reading the log file as follows: open(LOGFILE, "$logFile") || die "Error opening log file $logFile\n"; while(<LOGFILE>) { #Processing statements goes here. } Now in processing statements I want to check if the file reading pointer is on the last line. if yes then wan...

Model-specific SQL logging in rails

In my rails application, I have a background process runner, model name Worker, that checks for new tasks to run every 10 seconds. This check generates two SQL queries each time - one to look for new jobs, one to delete old completed ones. The problem with this - the main log file gets spammed for each of those queries. Can I direct t...

Log WCF Service Calls with Parameter information

I've been using the Service Trace Viewer to analyse the WCF service calls that are made in our application but I really need to see the parameter values that are passed to the service methods? Is this possible? I've tried turning the logging to max output but still can't see anything :( ...

Monitor How Often Assemblies Are Loaded From GAC

I currently have 3 servers each running different applications. Occasionally through installation misconfiguration and code re-factoring these machines are left with assemblies in the GAC that are no longer being referenced or used by anything. Are there any tools anybody is aware of to monitor / log how often, or when certain assembli...

How to effectively log asynchronously?

I am using Enterprise Library 4 on one of my projects for logging (and other purposes). I've noticed that there is some cost to the logging that I am doing that I can mitigate by doing the logging on a separate thread. The way I am doing this now is that I create a LogEntry object and then I call BeginInvoke on a delegate that calls Lo...

Are there logging frameworks or well-known design patterns for Ada in addition to Alog (http://www.nongnu.org/alog/)?

Such as something similar to log4j? ...