logging

How to consistently organize code for debugging ?

When working in a big project that requires debugging (like every project) you realize how much people love "printf" before the IDE's built-in debugger. By this I mean Sometimes you need to render variable values to screen (specially for interactive debugging). Sometimes to log them in a file Sometimes you have to change the visibility...

When logging when is an error fatal?

In logging frameworks like log4j & log4net you have the ability to log various levels of information. Most of the levels have obvious intentions (such as what a "Debug" log is vs. a "Error"). However, one thing that I have always been timid on was classifying my logging as "Fatal". What type of errors are so severe that they should be c...

Java RMI tracing

Is there a tool which traces & logs all RMI activity of a Java application? ...

How can I make log4perl output easier to read?

When using log4perl, the debug log layout that I'm using is : log4perl.appender.D10.layout=PatternLayout log4perl.appender.D10.layout.ConversionPattern=%d [pid=%P] %p %F{1} (%L) %M %m%n log4perl.appender.D10.Filter = DebugAndUp This produces very verbose debug logs, for example: 2008/11/26 11:57:28 [pid=25485] DEBUG SomeModule.pm (33...

Set Event Log settings via GPO

How would I set the "overwrite as needed" setting on Event logs other than Application/Security/System? Specifically I'd like to apply this to the Powershell and Windows Powershell Logs, in addition to any other future logs that may be added. This needs to be applied to both server 2003 & 2008. ...

Logging over the wire?

We have cases wherein we write a lot of log files to the host increasing the i/o on a host. Are there any good open source logging over the wire solutions. The application language is C++ on Red Hat Linux 3. ...

logging for web application

I'm in the middle of building a pretty big site using asp.net (forms if it's of any interest), and I'm wondering if i need a logging framework such as log4net. I've used such frameworks before, but i don't see how i could put it to any use in this type of project. usually i think logging is needed for customer delivered application, wher...

How to configure binlog to get User-Information?

Hi, I need to get an auditrail in mysql; is there a way to configure the binary log to get not only the changes, also the user, (connection) who made this change? Or do I have to use mySQL Proxy? TIA Peter ...

Logging capabilities on Server2008 / iis7?

Hello there I am suddenly resposible for debugging/finding out what is wrong with an asp.net application that crashed its ApplicationPool some days ago. The 5 errors within 5 minutes failsafe we had set took it down. The problem is that it was still served pages and thus returned a 503 for just some visitors. We have inadequate logging ...

Where is the Visual Studio 2008 Crash Log?

I have Visual Studio 2008 with SP1 installed and it is crashing when I'm using lambda expressions in the Moq Framework. At first I thought the problem was Resharper...but now that I have uninstalled it, VS 2008 still crashes. I'm able to replicate the issue every time. I'm thinking perhaps it may be some other plugin that is causing th...

log4net - When to use 'nested diagnostic context' (NDC)?

Playing with log4net, I have seen the possibility to use a per-thread stack of context labels called the NDC. The labels pushed on this stack are displayed in a PatternLayout by specifying the %x or the %ndc format parameter. The usage is something like: ILog log = log4net.LogManager.GetLogger(...) ; //pattern layout format: "[%ndc...

How to log something in Rails in an independent log file?

In rails I want to log some information in a different log file and not the standard development.log or production.log. I want to do this logging from a model class. ...

TimedRotatingFileHandler Changing File Name?

I am trying to implement the python logging handler called TimedRotatingFileHandler. When it rolls over to midnight it appends the current day in the form: "YYYY-MM-DD". LOGGING_MSG_FORMAT = '%(name)-14s > [%(levelname)s] [%(asctime)s] : %(message)s' LOGGING_DATE_FORMAT = '%Y-%m-%d %H:%M:%S' logging.basicConfig( level=logging.DEB...

How do I find the type of the object instance of the caller of the current function?

Currently I have the function CreateLog() for creating a a log4net Log with name after the constructing instance's class. Typically used as in: class MessageReceiver { protected ILog Log = Util.CreateLog(); ... } If we remove lots of error handling the implementation boils down to: [EDIT: Please read the longer version of C...

Logging frameworks for embedded linux?

I need a small, portable framework for logging on embedded linux. Ideally it would output to a file or a socket, and having some sort of log rotation/compression would also be nice. So far, I've found a lot of frameworks, but almost all of them have daunting build procedures or require the use of application frameworks (e.g. log4cxx re...

PHP Logging framework?

I'm looking for a simple PHP logging framework. What I need is something simple to plug-in into our PHP project, allowing for some configuration file to state what to log (INFOrmation, DEBUGging, etc.) and where to log it (MySQL, syslog, logfile...) I've seen in Java you have log4j and for .NET you have log4net. In PHP there are some pr...

Python logging in Django

I'm developing a Django app, and I'm trying to use Python's logging module for error/trace logging. Ideally I'd like to have different loggers configured for different areas of the site. So far I've got all of this working, but one thing has me scratching my head. I have the root logger going to sys.stderr, and I have configured anoth...

How do I log to a table in SQL Server 2000?

I'm writing into a log file, but I want to log into a table named "Log" in my database. How can I accomplish this? ...

Remove all but the last 500,000 bytes from a file with the STL

Our logging class, when initialised, truncates the log file to 500,000 bytes. From then on, log statements are appended to the file. We do this to keep disk usage low, we're a commodity end-user product. Obviously keeping the first 500,000 bytes is not useful, so we keep the last 500,000 bytes. Our solution has some serious performanc...

c# windows-services - How do I handle logging exceptions?

I am creating a Windows service. When an exception occurrs, I handle it appropriately and create a log. I am using the decorator pattern, as there are many different ways people will be looking at these logs. I have an email logger, a file logger, and a windows event logger, all which inherit from LoggingDecorator, which implements ILogg...