logging

Is there any considerations when using log4net in an application that uses NHibernate or Castle ActiveRecord?

Hi all, I used log4net in a sample application based on tutorial here. It works very well. But when I use same code and configuration in my main application, nothing works. My application is based on Castle ActiveRecord that itself is based on NHibernate. Both Castle ActiveRecord and NHibernate uses log4net internally. I'm suspicious ab...

Spring logging by package name

I need to log many classes in some packages in a project which I can not change its source code. So I need a solution which I can specify package name, and with spring aop add logging to that package's classes without change them but I dont know how can I do that. How can I do that? ...

Logging application (a struts + ejb3 web application) specific logs to my own log file while server (Glassfish) specific logs to server.log

Hi, I am working on an enterprize application that is developed on Struts1.3 + EJB3.0 + Glassfish2.1.1. The requirement is to route my application logs to a file that I have defined and all server specific logs should go to glassfish's default logger i.e. server.log. I'm using log4j-1.2.15.jar and log4j.properties. The content of this...

Template to show method name and parameter values in Eclipse

Is there any way to have a template (Java -> Editor -> Templates) in Eclipse that generate something like this debug("methodName arg1=" + arg1 + " arg2=" + arg2 + " arg3=" + arg3); When used in a method. For instance: public void setImage(long rowId, long contactId, String thinggy) { // invoking the template here, produces this: ...

Adding a logger in production

I am making some changes on the live site and i constantly need to add loggers (print_r) throughout the page for me to test. The problem is the site is healily populated by staff and I need it so I am for sure the only one to see this logger. I heard I can wrap the logger in an if with my Ip address but i thought I while back i tried tha...

How to get android system log from a Java program

Does anyone know how to get the android device system log programatically using Java? This would be something similar to what is available on lower panel on the Dalvik Debug Monitor. Thanks in advance. ...

How to programatically log PerformanceCounter

I understand that using Perfmon.msc you can create a custom performance counter and by using counter log, you can write the counter value to a text file. I also understand I can also use this programatically by creating a performance counter by using System.Diagnostics.PerformanceCounter, and get the counter value using NextValue() meth...

PHP error reporting: some errors to screen, all to log

I want to know how I can display E_ERROR error messages to the screen but write E_ALL error messages to the error log, we currently use the error_reporting() in our app index page so we can change error reporting without the need to constantly restart the web server, but it seems that this (or perhaps the way it's meant to work) means th...

Logback sometimes does not write to the log file, and sometimes does not roll the log file

Sometimes when I launch my java application, logback refuses to write anything to my logfile. Sometimes it also refuses to roll the logfile at midnight (or at the first logging event after midnight), which results in logging events being lost to the void. When i look at my main log file when logbacks has failed to roll the log, it will h...

How best to unit test Spring's SimpleMappingExceptionResolver

I have extended org.springframework.web.servlet.handler.SimpleMappingExceptionResolver to log and return custom error messages to my Spring MVC application. My question is - how should I go about writing a JUnit test to check that the correct errors get returned when the associated Exceptions get thrown? ...

Logging in C#: Getting the class/method name performance

I've recently been tasked with adding logging statements to every method call in a solution. These log entries need to contain the class and method name. I know I can use MethodBase.GetCurrentMethod() and the StackFrame.GetMethod() methods. Which is better? Is there a better (or more performant) way to get the class and method name? ...

Log Management Systems Dealing with Unknown Data?

We had an discussion with an analyst today about log management systems that deal with how unknown data sources. We just announced new technology that will allow to ingest, process and understand ANY type of data that can come to our log management system. (Full Disclosure: I work for LogLogic.) It was the conjecture of the analyst tha...

Need to know how to check if the inputted string has terminated within a thread-safe logger in C++

I am very new at this and apologise if my question is not clear. I have created a thread safe logger in C++. This logger will be used in a large program & will be called from multiple places. I am using a singleton so there is only one instance of the logger. This logger outputs to a file & to the console. It behaves similar to cout; it...

Android adb logcat time filter

Does anyone know how to filter out the logcat ('adb shell logcat') so that it only shows the log statements after current date and time ? Thanks in advance. ...

LogCat like view in Eclipse for non Android development

LogCat is a nice tool for Android development. Wonder if similar tool with multi-tab logs filtering exists for normal Java development? Or may be there is some hack to send logs to LogCat from normal Java project? ...

append-only databases?

i need to log some data from multiple processes concurrently (on Windows), to be plotted and whatnot later. rrdtool is great, but i don't have data at regular intervals. what else is there? edit: basically, i don't have "time-series data", so the rrdtool tag may be a red herring. the data i want to log is tuples (url, requested at, ...

Not tracing WCF Service (diagnostics tracing)

I have a client (a Unit Test) that call to WCF Service (hosting in debug mode in Console application). I have an error in service but I dont know which. I need trace it, but not generate anything file svclog in client. any suggestions , any sample code works ? EDIT: I use logging EntLibrary 4.1. I think there are errors in configurati...

Why don't my logs print?

Log.i("CONNECT TO THE NETZ!","BOOM"); Prints nothing in LogCat. Why? ...

Logging a phantom error in production for android!?

Hello All! I have an android application that runs well on my emulator, but when i deploy the .apk to a real phone, it works for about 4-5 minutes and then unexpectedly crashes. Is there anyway I could get a stack trace or more helpful information to show up on the android when it does this? Any particular way to get a log? And also, ...

What are logging libraries for?

This may be a stupid question, as most of my programming consists of one-man scientific computing research prototypes and developing relatively low-level libraries. I've never programmed in the large in an enterprise environment before. I've always wondered, what are the main things that logging libraries make substantially easier than...