Questions tagged [logging]

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.

Filter by
Sorted by
Tagged with
5
votes
3answers
154 views

log4j 1.2 - own check for verbose logs?

In my code's package, I have a flag such as: public static final boolean LOGS_VERBOSE = false; And in worker classes (multi threaded ...
3
votes
1answer
84 views

Simplest WP7 logger

Just ended up with this approach for wp7 (no tag yet), in case someone would find it useful. Also, improvement considerations are welcome. It works with ...
5
votes
1answer
1k views

Review Simple Logparser

This is my first try with Python. I wanted to parse some Log4J so I thought it a good opportunity to write my first Python program. The format of the logs I deal ...
3
votes
1answer
159 views

Filtering file for command line tool

I've written a little command-line utility for filtering log files. It's like grep, except instead of operating on lines it operates on log4j-style messages, which may span multiple lines, with the ...
6
votes
2answers
190 views

Bash log monitoring

I've made a Bash script to monitor some server log files for certain data and my method probably isn't the most efficient. One section specifically bugs me is that I have to write a newline to the ...
3
votes
5answers
383 views

Parsing a tabular log file into a hashmap

I have this method that reads a file into a hashmap. I feel like there are too many levels in this code with all these tries, ifs and so on. How do you think this can be improved? ...
4
votes
2answers
17k views

More Elegant Solution to Logging Class

I got this class in C# which works fine. But I was wondering if there was a more elegant solution to what I am trying to do. It looks rather clumsy and inefficient for a Logging functionality. The ...
3
votes
1answer
153 views

Any side effects from this Python logging code?

...
1
vote
2answers
879 views

Encapsulating logging and throwing exceptions into a method. Bad practice?

original code example ...
2
votes
2answers
883 views

Wrapping an Exception with context-management, using the with statement [closed]

Before I try to make this work, I wondered if anyone had tried this, whether it was a good idea or not, etc. I find myself doing this a lot: ...
5
votes
3answers
12k views

Running over a log file to extract log times

I need to run over a log file with plenty of entries (25+GB) in Python to extract some log times. The snippet below works. On my test file, I'm ending up with roughly ...
4
votes
4answers
4k views

Little log engine in C

I programmed a little log engine in C I plan to use in my project and maybe some others in future. I am very novice C programmer and would like to have feedback of some experienced ones on this. It's ...
3
votes
1answer
7k views

localStorage functions for website shopping cart

As part of a larger web app we are producing, I was asked to help build functionality to tie a page's shopping cart into localStorage for persistence. What follows ...
1
vote
1answer
53 views

Checking for a logged user

I have two classes with similar first checking codes, but different behaviors. I suppose there is a way to refactor the code, so I don't need to retype it every time. Is it possible to refactor this, ...
6
votes
1answer
256 views

PBKDF2 authorization

I've discovered that using hashed passwords with salts is a much better idea than MD5/SHA256, so I'm not hashing them with PBKDF2. However, I'm wondering if this is a correct approach to authorizing ...
0
votes
2answers
12k views

ASP.net proper login - logout classes - control login status

Would you have any suggestions improvements for the below functions classes ? Ok here how do i make a registered member login ...
2
votes
5answers
240 views

Logging input and log file strings

This is a piece of C89 code testing a function titled logging_function(), which takes two arguments and uses them to log a bit of information. In this case, the ...
5
votes
1answer
93 views

Selecting and copying event log entries for some machine

I have a PL/pgSQL function with erratic performance: ...
3
votes
1answer
163 views

Logging system safety

I've created a logging system with one-use passwords (sent via SMS API). What I would like to know is if it's "safe". I know it is hard to estimate safety but I am curious if it is safer than regular ...
4
votes
1answer
3k views

How's my approach to logging?

I was surprised that I didn't find this approach to logging anywhere while reading up on the subject. So, naturally, I think I may be doing something wrong. I set up some simple tests, and this seems ...
3
votes
2answers
283 views

Logger class for logging connections

I have this class whose code I pasted in full. The CredentialsManager class is not shown here as all it does is return the DB connection variables. Can be improved ...
4
votes
1answer
1k views

Filtering lines in a log file using multiple regexes

In python2.7: 2 for loops are always a little inefficient, especially in python. Is there a better way to write the following filter function? It tags a line from a log file, if it is useful. ...
4
votes
1answer
342 views

Dynamic IP-address logging

Inspired by Don Stewart's article on Scripting with Haskell I tried a rewrite of a shell-script I did the other day. I was really astonished how easily it worked but as a whole it is about double the ...
4
votes
2answers
4k views

Robust logging solution to file on disk from multiple threads on serverside code

I have implemented a socket listener that runs on my Linux Ubuntu server accepting connections and then starting up a new thread to listen on those connections (classic socket listener approach). ...
4
votes
3answers
434 views

Possible buffer overflow dangers in C log parsing program

After hours of working, I've finally finished my first C log parsing program! (previously was a bash script, now it is C). Although I think I've gotten most everything, I was just wondering if you ...
7
votes
1answer
280 views

Periodically comparing the play count of two Last.FM users

There is some little program (using a Last.FM API wrapper) which gets the play count of 2 specific users every 5 minutes and appends the difference between these 2 numbers to log file. Can you review ...
3
votes
1answer
594 views

GZip archiver for log files

It compiles, works well, solves my problem of zipping old or big log files and removes them from a hard drive. However, following this answer, I would like to know what was wrong with the code. ...
4
votes
2answers
348 views

Extracting the five most frequent queries from a log file

I'm trying to print the top 5 most queried strings from a text file. I can't use other third-party libraries to make it easier w.r.t hashmap implementations. I need to improve on these if possible: ...
50
votes
2answers
67k views

Redirecting subprocesses' output (stdout and stderr) to the logging module

I'm working on a Python script and I was searching for a method to redirect stdout and stderr of a subprocess to the logging ...
5
votes
4answers
2k views

How do I improve this logging mechanism?

There are quite a few things I am considering: I will have to check for null values I will have serious trouble persisting it in the database. How do I improve ...
3
votes
2answers
1k views

Is calling file write in the dispose acceptable?

...