Computer data logging is the process of recording events in a computer program, usually with a certain scope, in order to provide an audit trail that can be used to understand the activity of the system and to diagnose problems.

learn more… | top users | synonyms

18
votes
4answers
4k views

What is the correct way to handle debug output in Java?

As my current Java projects grow bigger and bigger, I feel a likewise growing need to insert debug output in several points of my code. To enable or disable this feature appropriately, depending on ...
6
votes
3answers
1k views

Exception Handling Frequency/Log Detail

I am working on a fairly complex .NET application that interacts with another application. Many single-line statements are possible culprits for throwing an Exception and there is often nothing I can ...
5
votes
2answers
349 views

Logging in JSON Effect on Performance

I see more and more articles about logging in JSON. You can also find one on NodeJS blog. Why does everyone like it so much? I can only see more operations getting involved: A couple new objects ...
4
votes
1answer
791 views

Best Creational Pattern for loggers in a multi-threaded system?

This is a follow up question on my past questions : Concurrency pattern of logger in multithreaded application As suggested by others, I am putting this question separately. As the learning from ...
7
votes
2answers
435 views

Concurrency pattern of logger in multithreaded application

The context: We are working on a multi-threaded (Linux-C) application that follows a pipeline model. Each module has a private thread and encapsulated objects which do processing of data; and each ...
8
votes
7answers
9k views

Best practices for logging user actions in production

I was planning on logging a lot of different stuff in my production environment, things like when a user: Logs In, Logs Off Change Profile Edit Account settings Change password ... etc Is this a ...
2
votes
1answer
411 views

tail-like view on HTML logfiles

I'm working on an application that creates HTML log files. I'm tired of having to manually reload and scroll to the bottom in the browser to see the latest entries. A solution that does not really ...
5
votes
2answers
150 views

Database Change Auditing - Part of or Abstracted from ORM / Application Layer?

My fellow developers and I are at a crossroads in how to go about continuing our auditing of database changes. Most of our applications log changes via INSERT, UPDATE, and DELETE triggers. A few of ...
6
votes
6answers
1k views

Rules and advice for logging?

In my organization we've put together some rules / guildelines about logging that I would like to know if you can add to or comment. We use Java but you may comment in general about loggin - rules ...
7
votes
5answers
279 views

Is there a pattern or logical structure I can follow for Event Log Numbers?

What are some ideas or structure I can use when assigning EventID to events that will be saved to the Windows Event Log? Some options I've considered Sequential (0... int.Max) Multiple of ...
6
votes
4answers
335 views

Logging errors caused by exceptions deep in the application

What are best-practices for logging deep within an application's source? Is it bad practice to have multiple event log entries for a single error? For example, let's say that I have an ETL system ...
1
vote
2answers
398 views

Logging asynchronously - how should it be done?

In many of the services I work on there are a lot of logging being done. The services are WCF services(mostly) which use the .NET EventLogger class. I'm in the process of improving these services' ...
14
votes
2answers
645 views

Should You Log From Library Code?

If I am developing a Java library, is it good practice to issue log statements from within the library's code? Having logging within the library will make debugging and troubleshooting more ...
1
vote
3answers
93 views

Communicating details of method result?

I have code like this (pseudocode) foreach(Box box in boxes) { if(boxFilter.PassesFilter(box)) { // do something useful } else { Log.Log(format("Box %s was rejected", ...
6
votes
3answers
295 views

What should I do with production error logs?

We have a PHP intranet site that we run with warning/error logging on (as it's not under heavy load and there's a number of bugs/bad code left to find). Because the site is relatively unstable and in ...
10
votes
6answers
1k views

Need to make my code more readable to the other programers in my team

I am working a project in delphi 7 and I am creating a installer for the application, there are Three main parts. PostgreSQL installation/uninstallation myapplication ( setup of myapplication is ...
15
votes
6answers
34k views

Why doesn't “object reference not set to an instance of an object” tell us which object?

We're launching a system, and we sometimes get the famous exception NullReferenceException with the message Object reference not set to an instance of an object. However, in a method where we have ...
3
votes
2answers
192 views

What percentage of code and runtime do you typically allow for testing?

When I write code, a certain amount of it is just for the purpose of logging, tracing, or otherwise "testing" what the program is doing. This not unit testing; this is not when it is running in ...
2
votes
3answers
83 views

Allowing the user to specify the location of a logfile

I'm working on an application, and adding logging, but now I'm stuck. I want to allow (not force!) the user to set the location of the logfile. Basically, my problem is: logger initialization ...
8
votes
2answers
383 views

How should I handle logging when I create libraries for others?

All. I am creating some libraries for other teams in my company. They all have different logging mechanisms. I want to provide trace information of what my libraries are doing. What should I to ...
12
votes
2answers
942 views

Is it more sensible to log exceptions in a catch-all or in a base exception class?

I'm in the process of refactoring a fairly large web app. One of the major issues is inconsistent error handling and I'm trying to come up with a sensible strategy. I've created a custom error ...
3
votes
3answers
177 views

Filesystems that use logging: If you're writing the data in the log (on disk), and in the actual locations themselves (also on disk) then…?

Aren't you essentially writing the same data twice, to the disk? Doesn't this cause a slowdown of a factor of ~2x? What optimizations can be made to minimize the cost of having to write things twice? ...
42
votes
9answers
3k views

What are some patterns and anti-patterns of application logging? [closed]

I recently had to investigate a field issue for our large enterprise application. I was horrified by the logs that I had to comb through in an attempt to find the problem and at the end of the day the ...
6
votes
3answers
246 views

Multitasking how to keep track of what you're doing

I'm in a long debugging task, I need to figure out where to hook up some extra functionality I need. It's cumbersome work, and I've been debugging 2 whole days, and I'm on my third, but I work in ...
7
votes
11answers
678 views

Is it practical to use Twitter for service logs?

Recently my boss suggested that we post logs of our service that is hosted on Windows Azure into twitter. His idea is that it's conveniently readable and if Azure cloud fails logs persist. He also ...
2
votes
2answers
827 views

Centralized and decentralized logging mechanisms

I've worked different kind of applications both having centralized and decentralized logging mechanisms. I feel centralized logging mechanism is good to see the proper flow of code and timing of ...
-3
votes
3answers
306 views

What's the meaning of “the Sun defect” and how does it differ from the more generic “NIH syndrome”? [closed]

I hear people talking about the "Sun defect", often giving the whole mess around logging as an example. How is it different from the not-invented-here syndrome, which means uselessly duplicating ...
4
votes
13answers
730 views

Logging, do you do it? [closed]

Back on my theme of late: interview questions. Was recently asked to describe a time I'd used logging. My first instinct was to respond with compiler warnings set to full and error-out. What he was ...
11
votes
7answers
2k views

From a design perspective, what are the best practices for logging? [closed]

I want to add logging to an application I'm currently working on. I've added logging before, that's not an issue here. But from a design perspective in an object-oriented language, what are the best ...
4
votes
2answers
148 views

Common Industry Term For Negative Logging?

It is one thing to log something that happened in code, a process, or procedure. It is another thing to log something that didn't happen. For example, if your ETL system is supposed to receive a ...
4
votes
4answers
298 views

Do you run production boxes with logs completely turned off?

We are internally debating in our team if we should continue to run our production boxes with logs turned off completely and just log errors and exceptions with log rotations. I want to know how ...
5
votes
5answers
282 views

Where to position logging statements

I have the following classes : class Task { public void DoSomething() { var s = new Service(); s.First(); s.Second(); s.Third(); } } class Service { ...
29
votes
3answers
12k views

Best practices for logging and tracing in .NET

I've been reading a lot about tracing and logging, trying to find some golden rule for best practices in the matter, but there isn't any. People say that good programmers produce good tracing, but put ...
21
votes
11answers
4k views

Logging: Why and What? [closed]

I've never written programs which make significant use of logging. The most I've done is to capture stack traces when exceptions happen. I was wondering, how much do other people log? Does it depend ...
4
votes
4answers
105 views

What features are helpful when performing remote debugging / diagnostics?

Obviously, the easiest way to solve a bug is to be able to reproduce it in-house. However, sometimes that is not practical. For starters, users are often not very good at providing you with useful ...
12
votes
6answers
2k views

What's the best way to manage error logging for exceptions?

Introduction If an error occurs on a website or system, it is of course useful to log it, and show the user a polite message with a reference code for the error. And if you have lots of systems, you ...
11
votes
5answers
658 views

When to start writing Exception Handling, Logging

When do you start writing your Exception Handling Code? When do you start writing Logging Statements. For the purpose of elaborating this question, let us assume that we are on .NET platform with ...
4
votes
2answers
370 views

How much logging should I do at production for SQLExcpetions?

I'm writing a small database-centric application in Java Swing that will be used internally in a small company. I haven't much experience with developing production-level applications. I don't use an ...
15
votes
8answers
2k views

Recommendations for .NET Logging components [closed]

I'm looking for a really good and light .NET logging component. I've used Enterprise Library and do like it but it's a bit heavy if you don't use other components in the collection. I've recently ...