Summary of daily Contents 42

Source: Internet
Author: User
Tags log4j

1. Log logs, related knowledge

The level of output information in log4j is divided into five levels: DEBUG, info, WARN, error, and fatal.
These five levels are sequential, DEBUG < INFO < WARN < ERROR < FATAL, it's important to understand this.
Here log4j has a rule: assume that the level is set to P, if a level q is higher than P, it can be started, otherwise it will be masked out.

Catalina.out and log file differences:
The catalina.out contains the output of Tomcat startup shutdown and the output in the console.
Log file to save the contents of the log logs. Includes the catalina.out output and the log output.

Debug level is the lowest, generally in the development of debugging when used. Use error or Info when development is complete.

2. The server disk is full, after deleting the file, the disk resource is still not released, the workaround:

(1) If you know the file name: lsof | grep nohup.out, find out what process is using this file, find it and kill it to free up space.

(2) If you don't know the file name: lsof | grep deleted, which will look for all files that have been deleted but not released by the file handle, and kill when found

3.nginx configuration Server cache and forward (source: Use Nginx as both load balancer and Web cache server )

#注: The path specified by Proxy_temp_path and Proxy_cache_path must be proxy_temp_path/data0/proxy_temp_dir in the same partition;   #设置Web缓存区名称为cache_one, the memory cache space size is 200mb,1 days to clean up the cache and the hard disk cache space is 30GB.    Proxy_cache_path/data0/proxy_cache_dir levels=1:2 keys_zone=cache_one:200m inactive=1d max_size=30g;   Upstream Backend_server {server 192.168.8.43:80 weight=1 max_fails=2 fail_timeout=30s;   Server 192.168.8.44:80 weight=1 max_fails=2 fail_timeout=30s;   Server 192.168.8.45:80 weight=1 max_fails=2 fail_timeout=30s;   } server {Listen 80;   server_name www.yourdomain.com 192.168.8.42;   Index index.html index.htm;    root/data0/htdocs/www;   Location/{#如果后端的服务器返回502, 504, execution timeout, etc., automatically forwards the request to another server in the upstream load balancer pool for failover.   Proxy_next_upstream http_502 http_504 error timeout invalid_header;   Proxy_cache Cache_one;   #对不同的HTTP状态码设置不同的缓存时间 proxy_cache_valid 304 12h;   #以域名, URI, parameters combined into the Web cache key value, Nginx based on the key value hash, storage cache content to the level two cache directory Proxy_cache_key $host $uri$is_args$args;   Proxy_set_header Host $host; Proxy_set_header X-FORwarded-for $remote _addr;   Proxy_pass Http://backend_server;   Expires 1d;   #用于清除缓存, assuming that a URL is http://192.168.8.42/test.txt, you can clear the cache of the URL by accessing Http://192.168.8.42/purge/test.txt.   Location ~/purge (/.*) {#设置只允许指定的IP或IP段才可以清除URL缓存.   Allow 127.0.0.1;   Allow 192.168.0.0/16;   Deny all;   Proxy_cache_purge Cache_one $host $1$is_args$args;   #扩展名以. PHP,. JSP,. CGI end of the dynamic application is not cached. Location ~. *\.   (php|jsp|cgi) $ {proxy_set_header Host $host;   Proxy_set_header x-forwarded-for $remote _addr;   Proxy_pass Http://backend_server;    }

Remove the index.html of the domain name suffix

Location =/index.html{            rewrite/index.html http://www/xxx.com  redirect;}

3. Other knowledge

(1) Ajax 302, indicating that the link is redirected, you need to check the filter or interceptor URL restrictions

(2) The absolute uri:http://ckeditor.com cannot be resolved in either web. xml or the jar files deployed with this application [Duplicate] missing jar package CKEditor

(3) Multiple projects are deployed in multiple tomcat, which can sometimes lead to session conflicts and workarounds:

In the Server.xml context tag add sessioncookiename, two tomcat name is not the same, such as a call SESSIONID1 a call Sessionid2
<context path= "" docbase= "D:/xxxxx" sessioncookiename= "Sessionid1"/>

(4) Group_concat (DISTINCT c.person_num) Personnum pieced together different person_num, separated by commas

(5) Date_format (CBM. Match_date, '%m ') Monthnum get the month directly inside the SQL

Date_format (CBM. Match_date, '%d ') Daynum get the number of days directly inside the SQL

(6) Du--max-depth=1-h view Sibling folder size

Summary of daily Contents 42

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.