logging

Where the application should store its logs in Mac OS?

I'm porting a Windows app written in C# to Mac OS using Java and Swing. The Windows app stores the logs (environment info, exceptions, etc.) in the file C:\Program Files\MyProgram\Logs\app.log. Occasionally I ask users to send me this file to diagnose problems. What is the right place for logs in Mac OS? If there are several possible ...

Rolling garbage collector logs in java

Is it possible to do a rolling of garbage collector logs in Sun JVM? Currently I generate logs using: -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCDateStamps -verbose:gc -Xloggc:gc.log But I have to manually rotate them using fifo queues and rotatelogs to create a new log for each day. I hope that there is a better solutio...

How do I create new Log4Net logs pragmatically?

I need the ability to log to create new log files and specify the name of the file at runtime using log4net. I am currently using a RollingFileAppender and it logs everything to one file given the name specified in the app.config. How can I explicitly tell log4net to start a new log and to name it accordingly? My Current Config: <log...

How do I write to the apache log files when using mod_wsgi

I have a Django project where I have been logging to a file using the standard library logging module. For a variety of reasons I would like to change it so that it writes to the Apache log files. I've seen quite a bit of discussion of how to do this with mod_python, but not mod_wsgi. How do I do this for a project running under mod_w...

C# Class Library: StreamWriter writing to system32 folder

I have a class library which is deployed on an ISP server to be consumed by an ASP.NET web service. I'd like to keep track of any errors and in this case the windows event log is inaccessible to me. So I thought I'd write to a txt file using the StreamWriter class. Problem is if I don't give an absolute path and just a file name it tries...

What's the point of a logging facade?

There are a bunch of different logging libraries to choose from, each with their own set of quirks and advantages. (.Net examples: log4net, System.Diagnostics.TraceSource, nLog, etc.) The natural inclination is to abstract away those quirks and use a logging facade. (examples: Castle.Services.Loigging, Common.Logging, Simple Logging Fa...

How can I digitally sign logs to ensure that they have not been modified?

In our application logs must be signed in order to prove that they have not been changed after they happened. This means that they must be signed using some sort of timestamp that links the signature with the time at which the log was written and signed. This way the log cannot be modified and signed again without changing that timesta...

EntLib Logger is not able to write LogEntry with a large message

Hi! I`m using EntLib 3.1 for logging in my application. Sometimes EntLib Logger is not able to log a message. XmlTraceListener is used. Especially, it happens when a message is relatively large, more than 1000 characters - exception stack trace. This very irritative when a customer sends you a log-file, that does not contain any inform...

SLF4J Log Level as an argument.

Hi, We are looking to use SLF4J, but one thing we found was that you can't specify the level as an argument, i.e Logger.log(Level.INFO, "messsage"); You have to do this logger.info("message"); this prevents being able to pass everything through a method, so you can tack other properties to all log messages in a class. public cl...

How to: log operations (sql) on one or more Sybase tables?

We have a hard to track-down bug in one of our systems, i.e. it appears very seldom and randomly so we figure good logging over an extensive time period would be helpful. Therefore I would like to ask if it's possible in any way to let Sybase (12.5.X or 15.X) log the SQL operations that updates the contents of a specific table, i.e. ins...

Weird behavior with the ObjectStateEntry's State

Hi all, I have the following extension method and i'm not sure why each entrys state is being changed to Unchanged after i call entry.AcceptChanges() on one entry. public static void SaveWithLogging(this ObjectContext context) { IEnumerable<ObjectStateEntry> entries = context.ObjectStateManager.GetObjectStateEntries(Ent...

Rails 3 my custom BufferedLogger

I would like to define a custom logger for my Rails 3 app, in a way that it does not replace the original logger (I still make use of its information). I assumed that I could define in a lib a class that inherited BufferedLogger as I've seen on some blogs. Then I would instantiate a variable to represent my logger, on the end of my appl...

redirecting log4j messages from a method to a different log file

Hi All, Right now i use log4j in its plain vanilla/out-of-the-box form. I've a log4j.properties file in the class path and various logger messages littered across the web application. Now i'm interested in redirecting log messages from a method "abc" in package "xyz" to go to a specific log file "pqr". I dont want all the logger message...

How to change root logging level programmatically

I have the following logback.xml file: <configuration debug="true"> <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> <encoder> <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern> </encoder> </appender> <root level="debug"> <appender-ref ref="STDOUT" /> </root> </configuration> Now, u...

Printing all the queries that mySql generates

I work with Workbench and phpMyAdmin with mySql, I use Procedures and Function etc... Sometimes one procedure triggers another Function and so on... eventually something goes wrong somewhere. Is there any tool known to anybody that can show all the queries mySql runs? Like a command prompt that shows every command MySql runs it would b...

High performance logging library for embedded applications

Hello, I am looking for a high performance logging library that I will use on an embedded device. I also want to say that I previously used PaulBunyan logging library which provided an efficient method for transferring information. [By efficient I meant it had a solution for transferring only the __LINE__ and __FILE__ when sending dat...

How to log STDOUT of a background process w/o buffering on Mac?

I am running a background process on Mac and have a problem with log update. If I run someprog > mylog & then mylog is updated not immediately, but with some intervals - I guess it's due to buffering. Same thing with at now. If I kill the program before output is written to mylog, then I loose the data. There was no such problem with ...

What is the difference between log4net.ThreadContext and log4net.LogicalThreadContext?

log4net provides two different "thread context" objects: ThreadContext and LogicalThreadContext, each of which has a property bag, Properties. ThreadContext has a ThreadContextProperties bag while LogicalThreadContext has a LogicalThreadContextProperties bag. ThreadContext is perhaps more commonly known as "MDC". LogicalContext is per...

Should logger be private static or not

Should logger be declared static or not? Usually I've seen two types of declaration for a logger : protected Log log = new Log4JLogger(aClass.class); or private static Log log = new Log4JLogger(aClass.class); Which one should be used? what are the pro's and con's of both? Thank you. ...

Django 1.2 : strange logging behavior

Hello ! I have a really strange problem with the standard logging module used in django views. Sometimes it works perfectly and sometimes it does not log messages. Here is the structure of my code : /mysite/ (Django root) my_logging.py (logging configuration) settings.py views.py (global views) data_objects.py (objects ...