logging

C# Detecting server setup

I'm writing a program that deals with the logs generated by the clients server. How can I detect where the user is storing them? It feels invasive to search all files, but what if they're being stored outside of the root. Is this acceptable, what if I make the user click "detect" first? Regardless, what if they've been renamed and reform...

How to configure logs/catalina.out of tomcat 6 for per-app. (Configure web-app specific log file for sys.out, sys.err)

Hi All, Requirement is this ... We have our 3 web-applications deployed in RHEL-5 server, we deployed apps with tomcat 6.0.16. We want to configure stdout, stderr, which are coming in tomcat/logs/catalina.out in app specific log file like, tomcat/logs/app1.log tomcat/logs/app2.log tomcat/logs/app3.log we are using log4j, but it is o...

Custom trace listener implementation. Write and WriteLine problematic behavior.

Hi. I want to implement a custom trace listener like follows: public class TraceListener : System.Diagnostics.TraceListener { public override void Write(string message) { LogToDatabase(message); } public override void WriteLine(string message) { LogToDatabase(message); } } Now suppose an error occ...

How to enable IP address logging with Log4Net

I'm looking a way to enable IP logging with log4net in ASP.NET. I found one solution but it works at Application level. Any suggestions/practices how to log IP at session level? Thanks ...

Using log4j in oc4j 10.1.3

I have a web application running on OC4J 10.1.3. I am trying to do some logging using log4j. The messages show up in my IDE console as expected, but nothing is going into the application.log in OC4J. Anybody know what I need to do to get this working? Here's my log4j.properties: log4j.rootCategory=DEBUG, CON1 # CON1 is set to be Co...

Can Python's logging format be modified depending on the message log level?

I'm using Python's logging mechanism to print output to the screen. I could do this with print statements, but I want to allow a finer-tuned granularity for the user to disable certain types of output. I like the format printed for errors, but would prefer a simpler format when the output level is "info." For example: logger.error(...

What is important to log for failed authentication attempts?

I am working on an authentication system for an online game programmed using PHP and I would like to make sure it is secure. To help with this, I think logging would be useful (and good practice for me as well as a good test for a system logging class). I dont want to use the web server's logs, but I would like to know what would be impo...

Message logging, find out where the messages come from?

At this point, we have three websites, an open api, some ten services, and numerous other parts of our infrastructure; and they all can send statistic messages into the queue. But, there is a problem, we would really like to know where the messages come from, as we had some issues in the past, where a statistic was logged when that shou...

What is the most performant way to log the name of class and method?

I basically want to write a customer logger/tracer which also logs the class and method name of the method that calls the logger/tracer. This should be fast so that it does not affect the performance of the application, strongly typed and clean. Does anyone have good ideas? Here are the few I had but I worry about performance due to ref...

__LINE__ equivalent in Java ?

I'm searching a way to include __LINE__ as a compile-time constant in outputted messages. Various solutions seem to exist, but with a big runtime penalty as suggested in __LINE__ in JS and __LINE__ in C#. They are usually always based upon a runtime object StackFrame as log4j. Using the log4j possibility of enabling/disabling on a nee...

Disable MySQL general logging without restarting?

Can I disable general logging completely without restarting the server? Because, per the documentation: SET sql_log_bin = {0|1} Disables or enables binary logging for the current connection (sql_log_bin is a session variable) if the client has the SUPER privilege. The statement is refused with an error if the client does not have tha...

How performant is StackFrame?

I am considering using something like StackFrame stackFrame = new StackFrame(1) to log the executing method, but I don't know about its performance implications. Is the stack trace something that is build anyway with each method call so performance should not be a concern or is it something that is only build when asked for it? Do you re...

NginX Log Rotation

I am serving a couple different domains through NginX on the same server and they each log to their own file. I need to set up a script to rotate, and compress these files and add it to cron. I know I have to do something to get NginX to open a new log file once I move the old one. Can someone give me the procedure for safely rotati...

Blackberry Simulator - printing only relevant debug messages

When debugging in the blackberry simulator, the console prints out a lot of other information relevant to the simulator along with the debug information printed in the application I develop. Is there a way to print only the debug messages of the application I am running in the simulator? ...

Rails logging best practices

Often I find myself inserting logging statements like this into my code: logger.info("orphaned_annotations: ".upcase + orphaned_annotations.to_s) logger.info("orphaned_anchors: ".upcase + orphaned_anchors.to_s) It seems like this would be a pretty common use-case -- is there an easier way to get this kind of functionality? ...

Easy way to log errors, etc to remote central location from .NET Compact Framework

Hi, I am looking for a very simple method for logging application errors and certain application metrics to a central remote location / server. I'm thinking it will need to be something like Web Services or some similar technology. One concern I have is device loses connectivity. I'd like to have something that stores the logs locally...

Configuring servlet logging properly under Resin

Hello. I have trouble to configure standard JDK logging resin uses. I have read the documentation many times and looked for examples, but in the end I'm still puzzled. I run a servlet under resin 4.0.1 with simple logging requirements. All logging configuration should be possible in web.xml (and not global resin.xml) resin (com.cauch...

Does a web interface exist for configuring log4j?

I need a web interface for configure log4j that gives me: CRUD of loggers, appenders and filters when I am OK with the configuration I want to click and download an xml version of the configuration hierarchical view of the configured loggers which expands as needed (nice to have). I am aware of this old thread but I can't find the lo...

Java Logging framework with parsers generated ?

hi, I'm looking for a java logging framework which enables to declare your own grammar and automatically generates the associated parser. Ideally, I would like to use log4j and generates a parser and then be able to manipulate these logs as objects. I've seen there's a scanner generator for log4j based on events but no parser. I gue...

Log to a database using log4j

Since in log4j javadoc is WARNING: This version of JDBCAppender is very likely to be completely replaced in the future. Moreoever, it does not log exceptions. What should I do to log to a database? ...