logging

Java: Instantiate or Inheritance?

I am writing a logging service for one of my applications but I am sure many other applications would use this. In that case, would it make sense to make the application extend a class and have all my logging enabled by default (because some logging like application entry point and exit point are required at any cost) in the original cla...

log pysvn update

How could I, if possible, get information on what files have been added, removed, updated etc when running svn update in pysvn? I want to write this information to a log file. ...

Overriding log4j settings at deploy time

For an application which is deployed on a large number of machines I took the decision to deploy a standard log4j.xml file with the application package, just to make sure that have the same settings are present everywhere : appenders, categories, levels. This does have the downside that when modifying the levels locally we risk losing t...

Creating daily logs with Log4j?

What configuration values are needed to setup Log4j to use the following pattern? MyApp-Mon.log MyApp-Tue.log MyApp-Wed.log Etc With each file containing the days log. This sounds easy enough to do with Log4j's DailyRollingFileAppender but I am having trouble. Here is my current config; <appender name="daily-file" class="org.apache.lo...

Cost of logging IP address for user activity

If I were to log user IP addresses for each function he/she performs would that slow up the application in any way? For example I might log the last sign-in IP, and because the IP address will be overwritten on next login, I would have to log the IP again in a separate table where he/she posts a message, and again for another site functi...

Programmatic configuration of Enterprise Library logging block

I've previously used log4net, but my current employer uses Enterprise Library application blocks. I had previously developed unit tests for my core logging classes as follows and was wondering is someone knew the equivalent for the OneTimeSetup code below for the logging app block (sorry for the long code post): public abstract class D...

What's a good way to collect logs from Amazon EC2 instances?

My app is hosted on an Amazon EC2 cluster. Each instance writes events to log files. I need to collect (and data mine) over these logs at the end of each day. What's a recommended way to collect these logs in a central location? I have thought of several options, not sure which way to go: scp them to an instance using a cron job Log al...

How would I robustly log binary or XML using slf4j/log4j/java.util.logging?

After doing logging for many years I have now reached a point where I need to be able to postprocess the log files with the long term goal of using the log files as a "transport medium" allowing me to persist objects et. al. so I can replay the backend requests. In order to do so I need to persist objects into a loggable form. The reco...

How shall I format my logs?

I'm writing a piece of honeypot software that will have extensive logging of interactions with it, I plan to log in plaintext .log files. I have two questions, from someone who isn't too familiar with how servers log, firstly how shall I break up my log files, I'm assuming after running this for a month I don't want one big .log file, d...

java wrapper around log4j logger and java.util.logging

I am writing a library. The library can be used by applications that use log4j loggers and java.util.logging loggers. So, I wrote a quick wrapper class, that encapsulates both loggers. I allow the application to set one or both loggers. And in my library I use the encapsulated class to print to either logger. My question is, since many...

How to get info: The Author/his Comments for the last subversion revision via command line?

I can't seem to find this one! So say someone like "Joe" (the Author) submits his code into the svn repository with the message "Fixed this bug and that bug yada yada" (his Comments). I'd like to get, via the svn.exe command line, the Author and his Comments for the latest revision. Maybe someone can tell me what arguments I could use ...

__unicode__(self) doesn't get called by logging

Long story short: # this works as expected: logging.error(my_object.__unicode__()) # this doesn't: logging.error(my_object) Same result with __str__(self). Why? EDIT: __str__ actually works. ...

Java custom logger: logging standards or/and best practices

I am developing a framework and I won't the jar to be light weight and independent as much as it can be. So I wrote my logging class: import java.util.Date; import java.util.Properties; public class Logger { private static final Logger me = new Logger(); private static boolean info = false; private static boolean debug = false; ...

EntLib logging - add/edit TraceListeners at runtime

I have a web application where I would like to add or edit Enterprise Library logging at runtime. I'm familiar with how to configure EntLib Logging completely programmatically and through the config file, but I would like to use a combination of the two. I'd like to have some base TraceListeners setup via the config file, but then at a...

fun error logging / reporting idea for small website

I want to write (or implement) a quick and easy logging solution for our website. I figure rss is fine for the format. I was thinking of piping apache's error log to a simple script that, if the url passes a blacklist, gets logged into a sqlite database. The database will store for each log entry the ip address, url, current count of th...

Implementing a fixed-size log file, or a circular buffer on disk

I checked this question, but it's not what I'm looking for. I'm trying to figure out how to cap a log file's size (say, 10MB), and as soon as it's hit, either: start writing to the beginning, rather than appending, or keep appending, but delete the contents from the beginning as I do so Don't really care about language - as long as...

ASP.NET health monitoring and performance counter

Hi all, Looking for best practice here. I know that there are multiple ways to do logging and exception handling in asp.net, for example, using enterprise library, log4net or even post sharp for AOP style logging. However, I haven't seen that many logging/exception handling articles related to health monitoring and performance counter...

Who is calling my WebService?

I have a web service that is on an internal server. It can be called from any website on our network. More and more developers are starting to use it. Current probably 20+ pages use this service, and the number is growing fast. I can see a year from now, someone asking what pages are using this service and what methods. I would like t...

PHP - recording errors

What is the best way to record errors experienced by the user? My initial thought was to make a function that recorded the error with a unique number and maybe a dump of the variables into a record on the database. Is there a better approach? Should I use a text file log instead? ...

Logging Mechanism using memory mapping technique

Just create a mapping of the file of the required size (CreateFileMapping or mmap), write the lines in the buffer and start over when the maximum number is reached. -- Your answer for write-a-circular-file-in-c. I am also writing the LogWriter module. In this caase i am mapping the whole file to the memory using mmap(). I am maintainin...