This seat has previously published an articleArticle: Log cutting and cleaning tools implemented in Java are heavily reproduced on the Network (although most of them do not indicate the source of the original article ^_^ ). There are a lot of official comments to this seat, hoping to provide toolsSource code. Therefore, this seat does not dare to copy itself, and now the sourceCodeShare it for your study an
After deploying Tomcat on a Linux server, running for a long time, the Catalina.out file will become more and more large, which has a certain impact on the stability of the system.Recently, a Java application on a Linux server has been suspended or dead.Then I have a "lack of space" hint when I enter a command.The result shows that the space of the system disk is occupied by the Tomcat7/logs directory. That would be a good deal.Erase all the logs. The
include many levels, such as error errors, warning warn, information info, etc., and have open source projects dedicated to logging, such as log4j to complete log management.5, the server side of the small Java program English is: Server Applet, so we put the server side of the small Java program called: Servlet.6, the use of
NetScaler Java settings when you log in via IEI believe that many people will encounter the Java security attribute setting limit in the initial deployment of the problem, see how to set the Java security settingsOpen Java Properties Panel in Control Panel, three diagrams to
, it has a feature that you might find relevant to the log.For the log Analysis tool, the biggest drawback is that you have to have logs to analyze. From the perspective of the integrated development environment, if there is no exception report, or no error message data, you can not know where the problem, so that any tool in the world can not help you! The Debug is stuck here. :(One of the advantages of TAKIPI is that you can skip
the thread that generated the log event
%n output a carriage return line break, Windows platform for "RN", Unix Platform is "n"
%d output log point of date or time, the default format is ISO8601, you can also specify the format after, such as:%d{yyyy MMM dd hh:mm:ss,sss}, output similar: October 18, 2002 22:10:28,921
3. Introduction of import Org.apache.commons.logging.Log in
stable Ubuntu version):PackageEu.Plumbr.Demo;Public ClassOOM{Public Static voidMain(String[]Args){Java.Util.ListInt[]>L= NewJava.Util.ArrayList();For (IntI= 10000;I 100000;I++) {Try {l. (new int[ 100_000_000); } catch (throwable T) {t.}}} Then you'll face the very same out of Memory:kill process message.Note that you might need to tweak the swapfile and heap sizes, in my testcase I used the 2g heap specified via -xmx2gswapoff -a dd if=/dev/zero of=swapfile bs=1024 count=655360mks
.
* Private Long Nextcheck = System.currenttimemillis ()-1;
Date now = new Date ();
SimpleDateFormat SDF;
Rollingcalendar rc = new Rollingcalendar ();
/** * The default constructor does nothing. * * Public Minuterollingappender () {}/** * Instantiate a
The test configuration file is as follows:
On the timing of implementation, you can also use Java provided timer implementation, but also eliminates each
Chapter 1: Project IntroductionLesson 1 Project Brief 14:50Chapter 2: Creating a projectLesson 2 Creating a database 09:40Lesson 3 Building Program Framework 09:09Chapter 3: Layout of the main windowLesson 4 Creating the main window 14:45Lesson 5 main Window Layout 10:57Lesson 6 Adding a menu bar 12:09Lesson 7 adding toolbars 13:29Lesson 8 Adding a button panel 11:29Lesson 9 Button linkage Operation 09:19Chapter 4: Log Capturelesson 10th
Java program starts, query to the currently running Java process through the JPS observation process, using theJava code
Jinfo–flag USESERIALGC Process
The way you can locate the GC policy that it uses, because these parameters are Boolean constants, and if you use that kind of GC policy, the + sign will appear, otherwise-No.Use-xx:+ the GC policy above to enable the corresponding GC policy.G
1. Get the RecorderUsing log4j, the first step is to get the logger, which will be responsible for controlling the log information. Its syntax is:public static Logger GetLogger (String name),The logger is obtained by the specified name and, if necessary, a new logger is created for the name. Name generally takes the names of this class, such as:static Logger Logger = Logger.getlogger (ServerWithLog4j.class.getName ());2. Read the configuration fileWhe
In the log file of your WebLogic Server, you may see exception
(Window nt)
Java. Io. ioexception Connection reset by peer
Java. Io. ioexception: clientabortexception: java.net. socketexception: Connection reset by peer: Socket write error
Java. Io. eofexception Connection reset by peer(Solaris)
Reason: Unknown, may be caused by the upgrade idea, previously played an upgrade patch;Error message:Information:java:javacTask: Source release 1.8 requires target release 1.8INFORMATION:2017/1/24 11:27-compilation completed with 1 error and 0 warnings in 5s 873msInformation:java:Errors occurred while compiling module ' java-lessions 'Information:javac 1.8.0_91 was used to compile Java sourcesInformation:mo
JVM in the Java application optimization is an indispensable major, how to properly configure the Java parameters, if the validity of the validation configuration parameters, from the GC log can be very important hints, the following is the GC garbage collector by default on the combination of the analysis of the log,
In the Linux operating system, it is often necessary to view the real-time output of log files, usually using tail -f or tailf commanding. Viewing real-time logs may require SSH to connect to a Linux host first, the steps are cumbersome, and if you are a production environment server, you may also be able to control various permissions. Real-time web-based logs can solve this problem.Because the traditional HTTP protocol is the request/response mode,
Log4jdbcIs a Java JDBC driver that can log SQL and/or jdbc cils (and optionally SQL timingInformation) for other JDBC drivers
The official homepage is code.google.com/p/log4jdbc/
A log tool that prints SQL statements based on slf4j.The latest version is 1.2 final.
It mainly describes usage:
1. Select the version, mainly jdbc3 and jdbc4.
(); Syslog.setcreatetime (New Date ()); Syslog.setuserid (Appuser.getuserid ()); Syslog.setusername (Appuser.getfullname () ); Syslog.setexeoperation (METHODDESCP); Systemlogservice.save (SysLog);} catch (Exception ex) {Logger.error (Ex.getmessage ());}}}}} return Point.proceed ();}}Configure the injection point with AOP:Note that because the default configuration for AOP is to run embedded code using a proxy, and if the strutsaction inherits Actionsupport, the error is caused by its use of the
In fact, if it is directly through JDBC to connect to the database, then the following link
Http://www.dankomannhaupt.de/projects/index.htmlJdbcappender.zip has been able to easily implement this function,
But in reality, especially in large applications, the basic is through DataSource to getConnection, and this zip has made it clear that it does not support DataSource, so what do we do?
I solve this, for the application of Java EE itself whether you
Daily development, operation and maintenance process often encounter the following issues:
Under what circumstances do I need to output a log?
How do I choose the log level when I explicitly need to output a log?
What do I need to output in the log when I explicitly need to output the
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.