= Response.getoutputstream ();
Out.println ("
1.6 Building Two JSP pagesA successful page refreshsuccess.jsp, the code is as follows
And a failed page refreshfailed.jsp, the code is slightly
1.7 Configuring Spring's Bean file (Service)Beanreflog4j.xml
1.8 Configuring Spring's Bean file (MVC)Beanrefmvc.xml
1.9 Introduce these two Spring profiles into your existing applications, or adjust them to your project structure
1.10 Configuring Web.xml FilesAdd the configurat
Official website: http://logging.apache.org/log4j/1.2/Log4j is a project of the Apache Foundation, a log recorder (Logger) is the core component of log processing, with a log4j of 7 levels.
Debug level: Indicates that fine-grained informational events are useful for debuggi
Please ask if you can save the error stack information that occurs when the program is running into the log file specified by log4j.
For example, a run-time error occurs while the program is running, and the following error stack information is printed in the console window:
Exception in thread "main" java.lang.ArithmeticException:/By zero
At Des.main (des.java:43)
I specify the
Research for a long time, found that log4j to SYSTEM.OUT.PRINTLN () does not support, so finally only the System.out.println () all to log4j.
Log4j.rootlogger=info,a1,r# ConsoleappenderLog4j.appender.a1=org.apache.log4j.consoleappenderLog4j.appender.a1.layout=org.apache.log4j.patternlayoutLog4j.appender.a1.layout.conversionpattern=%d{yyyy-mm-dd hh\:mm\:ss,sss} [%c]-[%p]%m%n# FileLog4j.appender.r=org.apache
Customer Requirements: log4j only the log content added in the program, masking any other log output.
Try to configure a bit of log4j.
1. Masks the log of spring components in the S2SH framework.
2. Masks the log of the Struts2 co
Refer to the online data: http://www.360doc.com/content/13/0527/11/10825198_288498671.shtml
Because the project needs to output some special log to do data statistics. If you turn on the info log level provided by log4j, the log files generated every day will become larger and bigger. This should be done by writing a
First you need to configure the Web.xml inside:
Then you need to write an implementation class
Package com.free.core.util;
Import Java.io.File;
Import Javax.servlet.http.HttpServlet;
Import Org.apache.log4j.xml.DOMConfigurator;
public class Log4j extends HttpServlet {
private static final long serialversionuid = -4046002537330149394l;
public void init () {
String path = This.getservletcontext (). Getrealpath ("/");
String f
number of partitions partions, the more the topic message is dispersed, the more evenly distributed message distribution in the cluster.
Then use the kafka-topics.sh--describe parameter to see topic for Kafka Details:
The first line of output is a summary of all partitions, and each subsequent row is a description of the partition. You can see the message topic for Kafka, Partioncount=4,replicationfactor=3 is exactly the number of partitions and backup factors we specified when we created it.
Copy the source code inside the Dailyrollingfileappender, and put it in the new named classes public class Minuterollingfileappender extends Fileappender, modify the two main places:
void RollOver () throws IOException {
/* Compute filename, but only if Datepattern is specified */if (Datepattern = = null) {Errorhandler.error ("Missing datepattern option in RollOver ().");Return}
String datedfilename = Filename+sdf.format (now);It is too early-roll over because we are still within theBounds of t
Simple test Project: 1, the new Java project structure is as follows:
The test class Flumetest code is as follows:
Package com.demo.flume;
Import Org.apache.log4j.Logger;
public class Flumetest {
private static final Logger Logger = Logger.getlogger (flumetest.class);
public static void Main (string[] args) throws Interruptedexception {for
(int i = i
Listen Kafka receive message consumer code as follows:
Package com.demo.flume; /** * Info:info * User:zhaokai * DATE:201
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.