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
2
votes
2answers
599 views

Custom log4net raising application-level events

Use Case: I have a form application in which I log events to a file/database and have a need to also raise those events to the application itself (for display purposes). Think old school updating ...
3
votes
1answer
2k views

Log4j Singleton

I'm trying to design and develop a singleton class that will handle resolution and configuration of log4j (not log4j2). The basic idea is to have a single class, reusable in any application, that ...
2
votes
0answers
108 views

Creating instances of a logger class for various logging levels

I provide a class to use but for convenience I want the class to implement some instance methods as static methods. This was fast and concise but it feels smelly, probably because I'm modifying the ...
4
votes
0answers
830 views

Passing a custom parameter through a logger

I have a custom logger which logs all messages at WARNING level and above to a Slack channel. Certain error messages occur so frequently that they make it hard to ...
1
vote
1answer
256 views

Monitoring errors with singleton

I need to monitor my functions for "errors" and want to print the warnings at the end of the functions. I thought using singleton class could be a good idea in here (code inspired by this example): <...
3
votes
0answers
537 views

Parsing simple log files in Julia vs Python

I wrote a log parser in Python and Julia. The Python version takes about 8 seconds to process 350 files, while the Julia version takes about 8 seconds to compile, after which it takes over 20 seconds ...
0
votes
1answer
100 views

Simple logger for a server

I wrote a simple logger for a server I'm writing. I'm wondering if anyone has any suggestions to improve it. doom_logger.erl ...
7
votes
1answer
864 views

A modern and extensible C++14 logger

I recently wrote this C++ Logger API code for a game engine. It needs to be as fast as possible so I tried to postpone everything to compile-time using different template meta-programming tricks (for ...
4
votes
1answer
2k views

Strip a newline and add more text to a Go bytes.Buffer

I wrote a little timer middleware to append the request duration to the end of the log message returned by the excellent Gorilla Toolkit's CombinedLoggingHandler ...
5
votes
2answers
187 views

Proper separation of concerns for stateful logger

This is a code review for a set of loggers following this question. The project is a universal windows application targeting Windows Phone. There are concerns over the tight coupling between the ...
4
votes
1answer
504 views

Log file mechanism

I want to create a generic log file which I can easily reuse in multiple files. Also, I want to be able to use the versatile std::cout so I can easily write ...
4
votes
0answers
838 views

subprocess with logging module: tee with StringIO

I've got a long-running process. Once it finishes I need the output. But the user should be informed while it's running. With the logging module I get timestamps ...
2
votes
2answers
3k views

A generic logger in modern C++

I've created a simple logging system that I'm planning to use and I've tried out some modern C++ features to make it generic. First I've made a log class that represents a single log message: ...
9
votes
1answer
6k views

Simple log writer class

I've written a simple log writing class. My code is also hosted on my Github. Specifically, I am looking for criticism on these items: Resource management. What is a more correct/safe way to ...
2
votes
2answers
268 views

Logging all API call traffic in Java servlets

We have a few servlets like the one below, taking JSON request and produce JSON response. And the requirement is to log all API call traffic. ...
1
vote
1answer
5k views

Spring AOP Log4j Logger example, improvement

I went through some of the stuffs on net regarding spring AOP and wrote a Spring AOP logger. Can you guys check my code and give your valuable inputs to improve it or if it is not proper, give me an ...
3
votes
0answers
197 views

Reading log file of subprocess

I run subprocesses with lot of output (compilation of Unity 3D projects). I use log parsers to find known issues. ...
4
votes
2answers
48 views

Process monitoring script

I wrote a script which logs memory usage of a process (pid in file), and reacts in case a limit is reached. I run the script nightly. In my case, the process concerned propably has a memory leak and ...
1
vote
1answer
78 views

Logging System - Follow Up

Previous question: C# Logging System I have took your answers on board and added the following changes to my LogManager.cs class: ...
3
votes
2answers
361 views

C# Logging System

I created a small logging class library and wanted you guys to check it out, I used to use Log4Net but thought I could create something more user friendly that was more suitable for my project than ...
8
votes
1answer
167 views

Log sorting program

This is my first ever program written in Rust (after reading the book). It is small tool to sort all lines from stdin according to two criteria. First one is time ...
2
votes
1answer
205 views

Arduino weather station logger

I made a program that uses the Adafruit pressure sensor, and the DHT22 temperature and humidity sensor to log pressure, temperature and humidity every 30 minutes. I left it outside my house overnight ...
1
vote
1answer
108 views

Android log in file for testing purpose

I have created a method which shows log in logcat and also writes into the file. Every time this method is called it appends String in file. There are so many read/write operations on disk/non-...
4
votes
4answers
536 views

Recurrence, recursive function

Type a number \$n\$. Then calculate \$f(n)\$, where $$ f(n) = \begin{cases} n-10 & \text{if}~ n > 100\\[1.5ex] f(f(n + 11)) & \text{otherwise} \end{cases} $$ The output must show all the ...
5
votes
2answers
250 views

Counting unique visitors in access log

I'm aware I am probably reinventing the wheel somewhat here, but I am trying to teach myself simple bash coding by completing simple tasks such as parsing files. To that end I am looking to learn ...
2
votes
1answer
717 views

Generating INSERT query from parameters

I use NLog everywhere and I really don't like writing the inserts everytime. You need to write the same variable three times: two for the insert and one for the parameter for example: ...
14
votes
1answer
2k views

Ambient Context

What do you think about this way to make logging available across the application without passing log object around? Let’s say we have something which allows us to ...
2
votes
2answers
269 views

Simple logging library in C

This header implements a very simple set of C (only) functions for logging. This is part of a larger collection of utility functions aimed to be used during the development process, meaning that they ...
6
votes
1answer
182 views

Python logging handler

I'm working on a logger that has a name of the module that called the logger (when I create an instance of a logger in my program, I call LoggingHandler(__name__)) ...
2
votes
1answer
2k views

Class of file uploading to S3 using boto with multipart supported

I'm writing an app by Flask with a feature to upload large file to S3 and made a class to handle this. I have some targets in writing code: Code must be easy to understand and maintain. (Yes, ...
5
votes
1answer
1k views

Wrapper for Java logging

I am currently working on a new version of my application, and I just finished rebuilding the log part. It works well but I am skeptical about the choices I made. I am a student and I work alone in ...
2
votes
2answers
186 views

Logging errors and debug messages

I'm currently working on a small project that uses Java to handle a socket-based MMO browser game. I'm still at the beginning of the project and I'm currently writing a class that logs errors and ...
0
votes
1answer
59 views

SQL message logger run loop

I am learning Java by reading source code of other authors. This Java method handles communication with SQL database. While the code does work several things concern me. For instance the ...
0
votes
3answers
919 views

Overwriting native console.log function in JavaScript

I want to override the console.log function in order to save the data other scripts log. My script executes before any other script, so I have full control over the ...
2
votes
0answers
40 views

Grouping logs and providing counts

The code is supposed to group start and end time logs and provide log counts and unique ID counts. The grouping will be variable 1 hour, 6 hours, 12 hours, 24 hours, etc. What is the better way to ...
17
votes
1answer
12k views

Scraping after login using Scrapy

I just finished a scraper in python using scrapy. The scraper logs in to a certain page and then scrapes a list of other pages using the authenticated session. It retrieves the title of these pages ...
5
votes
2answers
580 views

Splitting a CAN bus log in .asc format

I've written a quick script for a coworker to split a large CAN log into smaller chunks. (If you're not familiar with CAN, it's a communication protocol used by the ECUs in many cars.) I know where ...
3
votes
0answers
58 views

How to properly set a different formatter for a specific logger's child?

For certain modules or functions, I want to have a different format for the logged messages. I have done this in a way that looks a bit hacky: I have set a special Logger, containing a special Handler,...
3
votes
0answers
663 views

AngularJS client side logging in a MVC web application

Being a newbie into AngularJS, I have overlooked the importance of client side logging until some non-reproducible client-side errors occurred and I realized that they were not logged. My web ...
3
votes
2answers
8k views

Injectable logging with NLog and Ninject

I have been using NLog for logging purposes in my web applications, but it was not injectable. More precisely, each class using logging declared the logger like this: ...
0
votes
1answer
737 views

Python + spark to parse and save logs

I need to parse logs and have got following code. I can see two problems: map().filter() may induce some performance penalties and copy-paste block parser.py: <...
2
votes
1answer
47 views

Simple console directive, revised using provider

I recently created my first directive based on jQuery plugin and I asked for review here: Angular console like window - first directive I've edited my directive so now instead of ...
4
votes
1answer
145 views

Memory efficient Log Parser

I wrote this together for a test I'm doing that parses the Heroku access log. What I'm mainly interested is if this code follow common best practices and if there are any improvements I can make in ...
1
vote
0answers
144 views

Whois lookup tool

I've created a tool that searches for keywords given as ARGV then scrapes the first page of Google for the keywords, from there it logs all the urls found on Google,...
3
votes
3answers
104 views

Preventing floods while saving logs

I had a logging function… ...
6
votes
1answer
1k views

Logging object for C++

I've been always updating my log methods, because I started SDL and I needed some new methods. First, I made difference between debug and release, and so console and file. But now I want a more ...
7
votes
2answers
5k views

Lightweight logging library in C

I want to get some practice in writing C libraries and so started with something I can use straight away, a logging library. It is very basic and only has two levels: log everything and log only ...
5
votes
2answers
1k views

Method/parameter tracer

I am writing a class which can log the activity of an application during run time. The plan is that the SupportMI string will be sent to a DB, from where I can use ...
3
votes
1answer
62 views

Logging the load balance

I created a load balancing server at work and have to keep track of which server it adds the user to, so I wrote a little Ruby script that will do just that. I'm looking for any critique of my work, ...
2
votes
2answers
200 views

console.log helper function

I've seen the code for this function in John Resig's book 'Secrets of JavaScript Ninja' yesterday. I considered it useful at once because I've disliked repeatedly typing ...