What are some good methods to register your applications?

Registration can be complicated, fast. Given that you have code, how do you add a log to it? What library are you using?

What are some good code methods to get the most out of your logging statements with minimal impact on your application?

+6
logging
source share
4 answers

Some aspects that I would like to add about logging practice.

  • Make it a practice to separate the functional log from the development log. In a production environment, functional logging may include a DBMS or some other resource. We can achieve this by writing wrappers on the actual magazine.
  • In a multi-user environment, journal entries become difficult to read, have a unique user session identifier, and are logged during development. Then a simple perl script can filter out partitions, which simplifies debugging. Ease of use using wrapper classes as described above.
  • Wrapper classes also free you from being bound to one specific api protocol.
  • Try an aspect-oriented approach to logging where possible, this is essentially done with dot abbreviations (entry / exit points can be easily covered). Clearing the code will be easier.
0
source share

Libraries: Log4J and Log4Net (for Java and .NET respectively)

From the Log4J website:

Pasting log statements into your code is a low-tech method for debugging it. This may also be the only way, since debuggers are not always available or applicable. This often happens for distributed applications.

On the other hand, some people claim that journal entries pollute the source code and reduce readability. (We believe that this is true). In Java, where the preprocessor is not available, log statements increase the size of the code and reduce its speed, even when logging is disabled. Given that a reasonably sized application can contain thousands of log operators, speed is of particular importance.

With log4j, you can enable runtime logging without changing the application binary. The log4j package is designed so that these operators can remain in the sent code without high cost. Logical behavior can be controlled by editing the configuration file without touching the binary code of the application.

The log provides the developer with a detailed context for application crashes. On the other hand, testing provides quality control and confidence in the application. Logging and testing should not be confused. They complement each other. When journaling is wisely used, it can be an important tool.

+3
source share

In other matters, there were quite a few discussions. If you are a C # person take a look at What is the best logging solution for aC # net 3.5 or What is your journal philosophy?

Search the magazine and you will find many more. :)

+2
source share

Log4X Log Viewer: ChainSaw

+1
source share

All Articles