logging

Why both, import logging and import logging.config are needed?

Should not it be handled by a single import? i.e. import logging. If I do not include import logging.config in my script, it gives : AttributeError: 'module' object has no attribute 'config' ...

Logging how much.

Hi Here is our scenario. A wpf app works fine in dev environment. When published to other environments such as staging, UAT & prodn environments we run into issues. To figure out the issues is it a good idea to have a line which calls a log message after every line of code with Debug directives. If so how to handle it in release mode...

Quartz.net and Common.Logging - Using Log4Net

Hi, I'm using Quartz.net within a windows service. Currently, the trigger is not firing - I'd like to use the logging to find out why. I have edited my config file for thie windows service: <configSections> <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" /> <sectionGroup name="common">...

Use Python logging to determine where a method was called from

I'm trying to debug a Python Django app. I've got additional fields being added to a model. I've tracked this down to one method: django.db.models.options.add_field() The only place this method is called is: django.db.models.fields.init.contribute_to_class() def contribute_to_class(self, cls, name): self.set_attributes_from_name...

Procedure for exception handling (catch, log, report, fix) in end user desktop app

Hi I'm starting a new project, a end-user desktop application. I'm a concerned about what will happened if (ok, when) the end-user gets an unhandled exception. Asking the user to help me reproduce the bug is not an acceptable option. As I see it I'm left with one option: to upload an error report to my server. Years ago when I were a...

Enterprise library logging tracelistener for sqlite?

Is it possible to use Enterprise Library logging application block to log to a sqlite database? The standard Database TraceListener uses stored procs so I guess I'll need to create a Custom tracelistener or find one someone else has already done. Does anyone know of an implementation of this, or a similar sort of thing I could use as a ...

Use Rack::CommonLogger in Sinatra

I have a small web-server that I wrote with Sinatra. I want to be able to log messages to a log file. I've read through http://www.sinatrarb.com/api/index.html and www.sinatrarb.com/intro.html, and I see that Rack has something called Rack::CommonLogger, but I can't find any examples of how it can be accessed and used to log messages. ...

Standard for Windows Event Logging: Log nothing vs. Info vs. Warning vs. Error?

When should I log a message to the event log? Is there an accepted best practice for whether a particular event... Needs to be logged to the event log at all Is an error or a warning Is important enough info to logged as an info event in the event log ...

Logging data with scribe

None of the scribe examples I've seen actually mention the best way to take logs/logfiles and send them to scribe. I could configure a logrotate script that has a postrotate section that "cats" the rotated file to scribe (but then I get minutes latency at best). The other option is to keep a "tail -f= | my_scribe_sender" and hope that t...

How to log python program activity in Mac OS X

Hello, I'm pretty new to Python programming so I have this question: How can I log a Python application activity into /var/log with Mac OS X? I tried using syslog module, but it does not seem to write anything. I tried also with the logging module, but I always run into a permission error. How can I do it? Update: import logging im...

Changelog file: YAML vs JSON vs CSV

Hello everybody. I am creating a simple Changelog lib in CodeIgniter that will basically log a message everytime someone adds, deletes, changes or publish a blog post. I will log messages in files by batches of 300. So every 301st message will go in a new file. At first I wanted to write the logs to simple .log files but then I got the ...

How to refactor log4net statements in c# ?

Ok so after reading danben's answer on this post, I guess I'm convinced of the need for writting this kind of code, atleast in a lot of cases. My managers seem to be agreeing too. if (log.IsDebugEnabled) log.Debug("ZDRCreatorConfig("+rootelem.ToString()+")"); if (log.IsInfoEnabled) log.Info("Reading Configuration . . ."); T...

logging and tracing using Enterprise application blocks

Whats the difference between tracing and logging in enterprise application blocks? When to you use tracing against logging? Any examples would be great ...

enterprise library logging in C++ - logwriter->Dispose() error

I'm using Microsoft's enterprise library logging to log to a rolling flat file listener in my C++ dll. (IDE - VS2005) I'm having an issue that new files keep getting generated, with the GUID appended to the beginning of the file name. I've been googling this issue, and the solution seems to be to call logwriter.Dispose(). For some rea...

When working with gems in Rails, what does 'cannot remove Object::ClassMethods' stem from?

Frequently I have run into a problem when installing gems that provides a problem like: Does anyone know what this stems from? I've seen in it several different cases, yet still haven't learned what exactly is causing it. $ sudo rake gems:install --trace (in /u/app/releases/20100213003957) ** Invoke gems:install (first_time) ** Invoke ...

Non-locking TextWriterTraceListener?

I'm using TextWriterTraceListener to ouptput my trace information to a log file. Unfortunately it locks the logfile and I am not able to open it externally while the application is running. Any way to make this possible? ...

Commercial .NET logging tools?

Are there any good commercial .NET logging tools out there? I'm aware of the open source versions such as log4net and NLog, but does anyone know of any .NET logging tools with commercial support? ...

How to I disable and re-enable console logging in Python?

I am using python logging module and I want to disable the console logging for some time but it doesn't work. #!/usr/bin/python import logging logger = logging.getLogger() # this gets the root logger # ... here I add my own handlers #logger.removeHandler(sys.stdout) #logger.removeHandler(sys.stderr) print logging.handl...

Logger error Problem

I used Logger class in my application for catching the error and logging events. But at the time of writing the log to the text pad, it returns one exception like this Microsoft.Practices.ObjectBuilder2.BuildFailedException was unhandled by user code Message="The current build operation (build key Build Key[Microsoft.Practices.Enterp...

generating log timestamps using Stored procedures in SQL server 2005

I have a Stored Procedure, Which has some select Statements and insert statements. Is there any way , I can log the Timestamps of execution before and after the sqls inside the Stored procedure? ...