We’re rewarding the question askers & reputations are being recalculated! Read more.

All Questions

Filter by
Sorted by
Tagged with
3
votes
2answers
110 views

Do I use Repository or Service Object to Perform Logging?

I'm working in Java Spring, and I have typical service and repository layers. The repository grabs a JSON; passes it along to the service; service maps the repository response to a DTO. I also need ...
2
votes
2answers
98 views

How to implement change log of a ticket in complaint management system [closed]

One of the requirement, in the complaint management system were are designing, is to implement complete history of the ticket. For example Status was changed (new to pending to work in progres to ...
1
vote
1answer
152 views

Logging patterns from within library code

I am looking for a design pattern for logging from within library code. Suppose I have a function in a library file that i expect will be used by multiple front-ends (lets assume a CLI and a web): ...
3
votes
2answers
135 views

How would you go about designing a structured log pattern for systems?

My web app generate log entries on hooks such as model.save. Right now, I have a class Entry (representing a log entry) with a string field content to contain the text of the log entry. Examples of ...
6
votes
3answers
1k views

Better conditional debugging pattern?

Given the need to log only in debug mode the easiest way would be to use if conditions: def test(x, debug=False): if debug: print(x) # ...Some more code if debug: print("...
39
votes
6answers
5k views

Making code findable by using globally unique message IDs

A common pattern for locating a bug follows this script: Observe weirdness, for example, no output or a hanging program. Locate relevant message in log or program output, for example, "Could not find ...
7
votes
2answers
5k views

Logging events for reporting purposes

Are there any design patterns or best practices around logging events for use in reporting and BI systems. For example in a system which manages orders from a website, it would be beneficial if a ...
4
votes
3answers
874 views

Logging paradigms, DI/IoC, object hierarchies

I'm trying to figure out how to support the following example scenario ill be using C# as the example language. Scenario NASA is sending Rovers and Satellites to different Planets these vehicles ...
8
votes
4answers
8k views

Design pattern for wrapping logging around execution

Introduction I am implementing a abstract Java class of a processing framework*. By implementing the function execute, I am able to add business logical functionality. I would like to add logging at ...
1
vote
0answers
139 views

How to to log clicks for a Pay-Per-Click software?

Let say you have a Website with advertising, and each time a user clicks on it, you want to charge an advertiser the amount he bids (basically, a pay-per-click system, like Adswords, with a different ...
19
votes
6answers
5k views

Is logging next to an implementation a SRP violation?

When thinking of agile software development and all the principles (SRP, OCP, ...) I ask myself how to treat logging. Is logging next to an implementation a SRP violation? I would say yes because ...
12
votes
2answers
2k views

How should I handle logger failures?

In several of our company's applications, we use a custom logger. It's fairly robust, though we may replace it with something like NLog in the future. One of the logger's tasks is to log any ...
10
votes
4answers
24k views

Which design pattern is more suitable for logging?

I should log some events in a program but as far as I know it would be better to keep the logging code outside the program because it is not about the real functionality of the program. So may you ...
2
votes
2answers
782 views

Event based logging. Is it a good idea and is it ok to pass a handle to a “logged” object?

Hi I have fairly complex program that is doing computations in a quite large loop. I want to log some basic statistic about the run to be able to analyze its performance over time and vs loop number. ...
5
votes
2answers
7k views

Design pattern for logging changes in parent/child objects saved to database

I’ve got a 2 database tables in parent/child relationship as one-many. I’ve got three classes representing the data in these two tables: Parent Class { Public int ID {get; set;} .. other ...
6
votes
1answer
3k 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 ...
8
votes
2answers
3k 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 ...
7
votes
5answers
511 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 10, ...