I recently read the. NET developer debugging strategy. The book is good, but the translation is poor. However, some of the debugging experiences introduced in this article are good and rewarding.
Next I will summarize some of the applications of debug and trace in this book, which is regarded as a kind of Reading Notes.
A rough summary of several methods for modifying bugs:
Debug through the debugger
As its name implies, it is to track the source
Tags: Oracle performance databaseWhen Oracle queries come with efficiency issues, we often need to understand the problem so that we can solve the problem. Oracle provides trace information for SQL execution, which contains textual information about SQL statements, some execution statistics, waiting during processing, and information generated by the parsing phase, such as generating execution plans. This information helps you to diagnose performance
Spring AOP + Log4j records project logs and aoplog4j
Reprinted please indicate the source: http://www.cnblogs.com/Joanna-Yan/p/6567672.html
Project log records are essential for project development and operation. With such records, you can control the system as a whole and trace any problems.
If you use the pure OOP idea for log processing, you will find that every logical part will always be mixed into the
Spring Oauth2 In most cases is still not used, the main use is spring+springmvc+hibernate, sometimes with springsecurity, therefore, This article and the future article example will not contain the OAUTH2 configuration, need to put the former Applicationcontext-security.xml and Pom.xml plus on it, this article in the "ssh+spring Security building methods and example "the article is based on a number of adjustments, the main content is: Configure Spring AOP and use
Oracle Performance Analysis 1: Enabling SQL tracking and obtaining trace files
When there is an issue with Oracle query efficiency, we often need to understand the problem so that we can provide a solution to the problem. Oracle provides the trace information for SQL Execution, including the text information of SQL statements, execution statistics, waiting during processing, and information generated during
1. trace file introduction:
Trace file is a subsequent text file of TRC, which records various SQL operations and the time consumed, based on the trace file, we can understand which sqls lead to system performance bottlenecks and adopt appropriate methods for optimization.2. How to generate trace file:
1.First, use sql
The parameter configuration in the log4j configuration file is mainly divided into three parts: Priority configuration, log information output destination configuration, and log information output format configuration.
The log priority ranges from high to low, including error, warn, info, and debug, which are used to specify the importance of the log information;
The log output destination specifies whether the log will be printed to the console or a
1. Logger class
Use the static logger method logger. getrootlogger of the logger class to obtain the rootlogger. All other loggers are instantiated and obtained through the static method logger. getlogger. In this method, logger. getlogger takes the name of the logger as the parameter. Some other basic methods of the logger class are listed below:
Package org. Apache. log4j; Public class logger { // Creation and retrieval methods
Previous Test framework: http://www.cnblogs.com/tobecrazy/p/4553444.htmlWith Jenkins sustainable integration: http://www.cnblogs.com/tobecrazy/p/4529399.htmlPlaying log is one of the essential features of a test framework, and the trace test executes content that makes the test analysis easier and more regular to follow. The test log is further processed and the test results are automatically analyzed.Java Project write log now generally use
Raw Trace collection method
1. Open Trace, Help> Diagnostics> Trace with Binds and Waits.
Meaning of the Trace item
No Trace-turns trace off.
Regular Trace-generates a regular SQL
Starting from this section, we will analyze the source code of each amps module. Chinese comments are added to the main sections.
The tracing function is similar to the logging function used by software, but the recorded information is more detailed than the log. It can be used to see the running track of the entire code. amps supports the following trace levels:
Error
Warning
Debug
Debug_2
Info
The following three tracking modes are supported:
Trace macro is very useful for program debugging in VC and has functions similar to printf. This macro only appears in the debug version of the program, when release is enabled, the macro disappears completely, helping you reduce the amount of code during debugging.
The format is as follows:
Trace ("ddddddddddd ");
Trace ("Wewe % d", 333 );
There are also trace0,
Trace macro for VCProgramDebugging is very useful and has functions similar to printf;
This macro only appears in the debug version of the program. When release is used, the macro disappears completely, helping you reduce the number of debugging tasks during release.CodeQuantity.
Trace ("ddddddddddd"); trace ("Wewe % d", 333); trace0, trace1, and trace2
Trace macro for the VC under the program debugging is very useful things, with a similar function of printf, the macro is only in the debug version of the program appears, when the release of the macro is complete message, thus helping you to adjust the release also reduce the amount of code.
The use is very simple and the format is as follows:
TRACE ("ddddddddddd");
TR
Log4j is an open-source log component developed by Apache. log4j can control the delivery of log information to the console, files, and GUI components, and control the output format of each log; the configuration file can be used for flexible configuration to control the log generation process in greater detail. The following is a record of my basic usage of log4j
The attributes of the element of a trace
Properties
Description
Enabled
whether to enable application tracing . In order to use the Trace.axd Viewer, you must enable tracing. By default, the Trace.axd Viewer is added to the httphandlers element.The optional Boolean property.The default value is false.
Localonly
Specifies whether the trace viewer (Trac
From: http://dingjun1.javaeye.com/blog/413993
Reprinted:
Http://wangjc-opal.javaeye.com/blog/309924
There is no doubt about the powerful functions of log4j, but in actual applications, it is inevitable that an independent log file needs to be output for a function. How can we separate the required content from the original log, what about creating a separate log file? In fact, you can easily implement this function with a slight configuration based o
A new frame to do junit test times out of the following error.
Java.lang.Exception:DEBUG STACK TRACE for Poolbackeddatasource.close (). At Com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.close (abstractpoolbackeddatasource.java:417) at Sun.reflect.NativeMethodAccessorImpl.invoke0 (Native method) at Sun.reflect.NativeMethodAccessorImpl.invoke ( nativemethodaccessorimpl.java:39) at Sun.reflect.DelegatingMethodAccessorImpl.invoke ( DELEGATINGMETH
This article is for reprint study English Original:apache.org, compilation: Importnew-Tengkai Connection: http://www.importnew.com/3046.html About log4j 2 Log4j 2 is an upgraded version of log4j, with significant improvements compared to the previous version log4j 1.x, which improves the functionality of many logback
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.