logging

C# Am i using lock correctly?

I'm currently trying to write a thread-safe logger class. I'm not very familiar with correct design and best practices in this area. Is there a flaw in my code? public class WriteStuff { private readonly StreamWriter m_Writer; private readonly object m_WriteLock = new object (); public WriteStuff(String path) { m_Writer = File.Cr...

Richer logging/tracing status for C++ applications

There are plenty of logging/trace systems for letting your program output data or strings or state as it runs. Most of these let you print arbitrary strings which you can view live or after your program runs. I noticed an ad here on SO for Smartinspect which seems to take this to a higher level, giving stack traces for each log, fancier...

Glassfish Logging

Is there anyway to get glassfish to delete some of the old log files automatically? Yesterday we had a disk full issue due to glassfish logging. There is not apparent way to do this in the Admin Console, unless we are just ignorant. ...

SQL for counting events by date

I feel like I've seen this question asked before, but neither the SO search nor google is helping me... maybe I just don't know how to phrase the question. I need to count the number of events (in this case, logins) per day over a given time span so that I can make a graph of website usage. The query I have so far is this: select ...

What is the best way to log exceptions in Visual Basic, on an ASP.NET Application ?

I'm working on an ASP.NET web application, written using Visual Basic, and I'm trying to track down an error message that I'm getting. I'd like to get it to log the exception to a file (or the event log) so I can see it, as the error only occurs on the production server, and not on the development environment (therefore VS isn't instal...

How to log Postgres SQL queries?

Hi. Can anyone tell me how to enable logging of all SQL executed by Postgres (8.3)? Thanks! Edited (more info) I changed these lines : log_directory = 'pg_log' log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log' log_statement = 'all' And restart postgres service... But no log was created... I´m using Windows Server 2003 Any ide...

Handling repeated events in a log

I have a logging system where some events are repeated infinitely. for example: 12:03 - Restart attempted 12:03 - Restart failed 12:02 - Restart attempted 12:02 - Restart failed 12:01 - Restart attempted 12:01 - Restart failed This might go on for days. I imagine there are standard ways that systems deal with spammy events like this. ...

Best practice(s) for on screen real-time log viewer for log4net

I have a multi-threaded C# application that use log4net for logging capabilities. Mainly the RollingFileAppender. I want to offer the capability for the user to view the activity of the application in an "application log" window. This will consist of a listview (details mode), a grid or something similar. I'm looking for best ways to d...

Quartz scheduler not displaying Log4j messages.

Hi All, I am trying to configure my Quartz scheduler to support logging. I had tried doing following: Added log4j.xml in classes folder of my app. The code for the same is: log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.Target=System.out log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.ap...

Log4J - Speed of resolving class/method/line references

Does log4J still gather the class, method and line numbers by generating exceptions and inspecting the stack trace? Or has Java been optimized since Sun included their own logging framework. If not, why has there not been any optimizations made since. What is the main challenges in obtaining class, method and line numbers quickly and ...

How do I write to the console in Google App Engine?

Often when I am coding I just like to print little things (mostly the current value of variables) out to console. I don't see anything like this for Google App Engine, although I note that the Google App Engine Launcher does have a Log terminal. Is there any way to write to said Terminal, or to some other terminal, using Google App Engin...

Where to write log for Windows app

I've got a .NET Windows application that's deployed via ClickOnce to a Web server. There are approximately 100 users at any given time, all centrally located. I'm using log4net to log within the application, but I'm having trouble arriving at the best place to put the log. I've tried having them write to a shared network location, but s...

Overhead associated with OutputDebugString in release build.

Is there a significant overhead associated with calling OutputDebugString in release build? ...

How can I setup my BlazeDS implementation with Log4J?

Hi there. I'm writing a Flex app on top of a Java web application using BlazeDS. BlazeDS has logging inside of it, but I want to set it up to Use the same logging framework I have in my application. Is there a way to setup BlazeDS to use Log4J? Or am I stuck with the Flex logging stuff that's already baked into BlazeDS? ...

Log4Net RollingFileAppender with composite rolling style is overwritting data

I have a Log4Net RollingFileAppender that is configured as: <configuration> <configSections> <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/> </configSections> <log4net> <root> <level value="ALL" /> </root> <logger name="RollingFileAppender" additivity="false"> ...

Audit and log, all or selective, user input on ASP.NET web application. How would you?

I'm building UI logging into a long-existing ASP.NET enterprise application. I have my own ideas of how to progress from here and am continuing to research & design. But I'd love to hear some details from the SO community. Here are the details, assumptions and questions as of right now, subject to evolve within the enterprise as well as...

Is there an equivalent of Log4J for Ruby, Log4Ruby?

I looked around and couldn't find one. Is there an equivalent of Log4X for Ruby? If not what's the best way to handle all the debug statements. I'm fairly new to Ruby. Thanks! ...

How can I get CURRENT USERNAME in membership asp.net 2008

Hello, I use a membership in asp.net 2008. And I build a login system with some rolls ...etc I have a database and tables and the KEY is "username", and now I want to know how can I get a username for the member who logged in ? for example: I logged in as TURKI I want to get the username TURKI really I need for help... thanks, ...

Reporting information during code execution: best design

I always had doubts when it comes to designing proper report of execution. Say you have the following (stupid, to be simple) case. I will use python. def doStuff(): doStep1() doStep2() doStep3() Now, suppose you want to give a report of the various steps, if something goes wrong etc. Not really debug: just informative beh...

Best practice in designing a web app user activities logging?

We have a web e-learning type system, and for this project, I am supposed to design an activities logging feature for the whole system so we can track down their daily activities and perhaps help them to be more productive. Unfortunately this system most likely will be used to track the user's work during the official hours ( And the d...