the value of the variables in the process, and so on.
The generated log should be clear enough to separate the records by different threads, rather than generating each record in the order of time, otherwise it would be inconvenient to debug.
Realize
In the final sample code of the article, we present a typical JDI debugging tool logic and use it to profile the execution of a simple multithreaded proces
problem with variable printing is when you print without a placeholder or a splice character:1 logger.error ("Print cannotbeprinted:", cannotbeprinted); // wrong 2 logger.error ("Print canbeprinted:" + canbeprinted); // Good 3 // BetterNote that cannotbeprinted or canbeprinted are non-throwable variables. That is, the exception variable e does not apply to the above rules, but E.getmessage () applies.You can use the following regular expressions to troubleshoot non-canonical variable printing
This article link: http://blog.csdn.net/xietansheng/article/details/70478082
Usually the development of JAVA projects requires the Unified management log (log) output, such as control of the log information delivery destination (console, file, etc.), control the output format of each
How to Use log files for JAVA projects and java project log files
Recently I made a java Desktop program, which is drawn using SWT/jface on the interface. During this process, I want to use log4j to record the log information of t
Java log Design Practice (1), java log
During daily development and O M, you may encounter the following problems:
Under what conditions do I need to output logs?
How do I select the log level when it is clear that logs need to be output?
When it is clear that log
JAVA log4j Log File Usage, javalog4j Log File
// 1. Import jar package, log4j-1.2.17.jar// 2. Create the log4j. properties file under src// 3. Configure the properties File/*Log4j. rootLogger (effective for the entire project by default) = DEBUG, stdout (console), a, B ,...Log
On the project encountered a system will suddenly down the problem, because there is no detailed log information, baffled, and finally one day the problem appears again, the captured log information is:Error:transport error 202:handshake failed-connection prematurally closed ["transport.c", L41]JDWP exit Error Jvmti_error_none (0): Could not connect, timeout or fatal errorA search on the internet, the truth
#log_level.jmeter.engine=debug#log_level.jmeter.threads=debug#log_level.jmeter.gui=warn#log_ Level.jmeter.testelement=debug#log_level.jmeter.util=warn#log_level.jmeter.util.classfinder=warn#log_ level.jmeter.test=debug#log_level.jmeter.protocol.http=debug# for Cookiemanager,
How to Use jdb to debug Android Java programs
When I get used to GDB, I always feel that eclipse is too bloated and uncomfortable. See Li Xijing wrote an article "using jdb/jdbshell debugging Android program" (http://www.limodev.cn/blog/archives/1281), with the next, feel more comfortable than eclipse. Jdb commands are so awkward. I wrote a jdbshell and added the command history and alias (several common gd
port in the current window 1 and click Enable again.3. Exception BreakpointAn expression viewExpression view: The expression view is a more common view of the debug process, you can observe some of the variables you are interested in, you can add some of your own expressions, or you can see the results of a line of code running.1. Expressions2. Click this to add an expressionCode viewCode view: Used to display the specific code. Where the green part
step select "Edit configurations ..." drop-down box location Select the remote name created in the previous step, then click on the Debug button on the right (long as the bug that), look at the console log, if there is a similar "Connected to the Target VM, Address: ' xx.xx.xx.xx:5555 ', Transport: ' socket ' , means the connection was successful.Set breakpoints, start debuggingThe remote
line of code in the program or you write an assignment statement to change the value of variables and so on.9. Remote DebugRemote debug can be used to debug the remote server code, to ensure that your local code and remote deployment of code is consistent, you can debug the server code in this way, this is a great tool for J
filter function is used when you use single-step debugging. is the filter configuration, which is typical of some of the JDK's classes and package configurations. is to open the single-step filter at debug time, otherwise it will not take effect . Turn on single-step filtering These small debugging methods in our debugging project can indeed give us a lot of help, we must learn. 3 Remote Debugging This debugging method in our actual work developmen
Debug info unavailable The way to solve
Java's small partners estimate that there is a habit of breakpoint code, it is easy to see the runtime code of some variables in the value.But there are some classes in the JDK that you will find impossible to break, even if you associate Src.zip in the IDE. What is this for?
Answer:
Java classes which is part of the JDK is compiled without
=debug, blah # Add a consoleappender to the logger blah Log4j.appender.blah=org.apache.log4j.consoleappender # Set set ' layout to be simplelayout Log4j.appender.blah.layout=org.apache.log4j.simplelayout From here you can download: Plainlog4jconfig.txt. This is the program that executes the configuration file: Import Org.apache.log4j.Logger; Import Org.apache.log4j.PropertyConfigurator; public class Externalplaintest { static Logger Logger = Logger
Debugger Java application
To sum up some experiences on Java debug, Java developers generally debug Java programs through IDE, such as Eclipse. After being started in debug mode, you ca
Org.apache.log4j.PropertyConfigurator;public class Externalplaintest {static Logger Logger = Logger.getlogger (Externalplaintest.class);public static void Main (String args[]) {Propertyconfigurator.configure ("Plainlog4jconfig.xml");Logger.debug ("Here is some debug");Logger.info ("Here is some info");Logger.warn ("Here is some warn");Logger.error ("Here is some error");Logger.fatal ("Here is some fatal");}}You can download an example that uses this
As projects become more complex, no one can guarantee that their projects will run without errors, and errors are not scary, and the problem is to eliminate them in a timely manner, making the project more robust and continuing to run. Troubleshooting These errors requires getting an error message, where the information comes from, a well-designed project, and certainly a log of the project's running. More importantly, it can also complete tracking de
The Java remote Debugging feature can cause arbitrary commands to be executed remotely, which is prohibited by default in production. If necessary in the BETA/DEV environment, it must be monitored at 127.0.0.1 to avoid being remotely invoked.The way to hear 127.0.0.1Modify the Java remote debugging parameters in the address 127.0.0.1 to restart the Java program.B
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.