Catálogo de publicaciones - libros

Compartir en
redes sociales


Pro Apache Log4j

Samudra Gupta

Second Edition.

Resumen/Descripción – provisto por la editorial

No disponible.

Palabras clave – provistas por la editorial

Software Engineering/Programming and Operating Systems

Disponibilidad
Institución detectada Año de publicación Navegá Descargá Solicitá
No detectada 2005 SpringerLink

Información

Tipo de recurso:

libros

ISBN impreso

978-1-59059-499-5

ISBN electrónico

978-1-4302-0034-5

Editor responsable

Springer Nature

País de edición

Reino Unido

Fecha de publicación

Información sobre derechos de publicación

© Apress 2005

Tabla de contenidos

Introduction to Application Logging

Samudra Gupta

Spatial orientation in animals or in men requires memory as an essential feature and may be considered as a complex manifestation emerging from multiple brain structures with the hippocampus at “the crossroad”. In this chapter, we present the underlying biological mechanisms of spatial behavior along a contextual and historical dimension, in an ethological perspective. We propose that study of spatial memory in mammals, and more precisely in laboratory rats, sheds some light on the development and evolution of episodic memory.

Pp. 1-7

Understanding Apache log4j

Samudra Gupta

In this chapter, we have examined the various key objects in the log4j framework and explored how these objects interact to capture, filter, and produce logging information to various destinations. Besides the key objects, log4j involves many auxiliary objects that help handle the logging information. In the next chapter, you will learn about different Appender objects in log4j.

Pp. 9-34

Destination of Logging—The Appender Objects

Samudra Gupta

In this chapter, you have examined different Appender objects available in log4j, studied the configurable properties of each Appender, and seen examples of how to configure them through properties files and XML. You have also seen that some of the Appender objects can be configured only through XML-style configuration. You learned that log4j offers logging capabilities for stand-alone and distributed applications, and that logging information can be sent to remote destinations using technologies such as JMS, SMTP, and Telnet.

Although, log4j provides a substantial variety of Appender objects tomeet different application scenarios, the coverage may not be enough just for the application you are developing. Maybe you need something special. Don’t despair—in Chapter 6, you’ll learn how to write your own specialized Appender objects to meet the demands of your application.

Pp. 35-75

Formatting Logging Information in log4j

Samudra Gupta

In this chapter, I have discussed in detail how each Layout object behaves and to configure these objects through a configuration file. The log4j API provides a comprehensive set of Layout objects, which is sufficient for most applications. If your application needs amore sophisticated Layout object, you must create one for yourself. You will see how to write a new Layout object in Chapter 6. In the next chapter, you will see a complete example of using log4j in a real-life application.

Pp. 77-94

Filtering, Error Handling, and Special Rendering of Log Messages

Samudra Gupta

In this chapter, you have learned about filtering, error handling, and object rendering in Apache log4j. These are powerful techniques to tailor the final logging output according to the application software’s requirements. In complex application scenarios, these techniques become very useful for controlling the amount of logging information published and organizing it in such a way that it can be processed to generate reports for different functional aspects of an organization.

Pp. 95-114

Extending log4j to Create Custom Logging Components

Samudra Gupta

In this chapter, we have examined how to extend the existing log4j framework to write our own application-specific logging components. The plug-and-play nature of log4j makes it easy to integrate custom components into the existing framework. The default capability of log4j is versatile and meets most of the routine requirements in logging activity. However, you might venture to extend the existing framework should you really need it. This chapter provides a guideline for implementing custom logging components to use with log4j.

The next chapter presents a complete log4j example using the concepts discussed so far.

Pp. 115-147

A Complete log4j Example

Samudra Gupta

This chapter demonstrates the use of several log4j components in a real-life scenario. The configuration file used for these examples is in XML style because the Filter object and Renderer object can be configured only via XML style. This chapter also illustrates the simplicity and great extendibility of log4j. With simple components plugged in to the framework, log4j can achieve so much powerful logging. In the next chapter, we will examine how log4j fits into the J2EE world.

Pp. 149-155

log4j and J2EE

Samudra Gupta

This chapter focused on issues regarding the use of log4j in a J2EE environment. We have discussed the challenges of logging within a J2EE environment and demonstrated how log4j can be used within WebLogic by understanding the class-loading issues in WebLogic. Once you know how individual J2EE containers deal with different parts of a J2EE application, it will be fairly easy to figure out how to package log4j in your J2EE application.

Pp. 157-161

Using the Apache Log Tag Library

Samudra Gupta

In this chapter, we discussed a newly released tag library, Log, for using log4j within a JSP to perform logging. This solves the age-old problem of how to establish controlled logging from within a JSP. By changing the configuration, it is possible to redirect logging information to any preferred destination in any desired format. But careful consideration is required before you include in your Web application CPU-intensive logging operations such as writing logging data to a database, as it might affect the performance of that application.

This brings us to the end of the log4j discussion. All the topics explained in Chapters 2 through 9 should help you understand the internals of log4j and how to use it in practical applications. The smaller examples in these chapters should enable you to grasp the concepts presented and see quick results to better understand the use of log4j. The more extensive examples should help you correlate the use of log4j with real-life applications.

There is always more to learn about any topic. But we have created a skeleton and given it a shape, and now you are in a position to build on it. In Chapter 10, we will look at some of the best practices involved in using Apache log4j.

Pp. 163-173

Best Practices and Looking Forward to 1.3

Samudra Gupta

I hope the topics we’ve covered provide you with a solid foundation for working with the most popular logging API—Apache log4j. The final two parts of the book, Appendixes A and B, provide a brief comparison of log4j against the standard JDK logging API. Both are well-designed and easy to use. Considering the present status of both APIS, log4j, in my opinion, has a slight edge. But you are not always going to need such a sophisticated logging mechanism. The important point is to understand that every day, software applications are becoming more and more business- critical. In this context, an application with better maintainability and quick-fix capability wins. A well-planned logging framework within an application will no doubt help it gain some advantage in a competitive market. Hence, it is time for all of us to reconsider the importance of logging in our applications.

This chapter introduced the features that will be added to the 1.3 release of log4j. As this book is being written, version 1.3 is in its alpha stage. We hope it will be released soon. Its new features and improvements will surely make it very popular in the developer community.

As feedback flows to Sun and Apache for their logging APIs, we will see even more improvements and features being incorporated within log4j. Whatever these new features may be, the basics presented in this book will remain the same, and I hope this book will prove useful to you now and in the future.

Pp. 175-186