Write System logs in C language in Linux
__________________________________________________________________________________________________
Author: jobo
Time: 2011/11/24
Emaile: jibo.tiger@gmail.com
Statement: I am not opposed to reprinting my articles by other people and groups, but please indicate the source, 3q. If you have any questions about this article
Leave a message in the blog or send an emaile to contact me (you cannot reply in time. The time is limited. Please forgive me)
___________
Directory
Oom Exception--intsmaze
Correct posture dump file analysis--intsmaze
The right Posture--intsmaze
Dump lost print--intsmaze
Which memory overflows will generate dump files--intsmaze
The application has an Oom exception, do you still look at the log to troubleshoot the problem (the way t
. Net rapid development integration framework (rdiframework. Net)
5.4 platform logs, exception management, and automatic configuration file generation
. Net rapid development integration framework (rdiframework. Net), A. Net-based rapid development and integration framework, provides users and developers with the best. NET Framework Deployment Solution.
5.4 platform lo
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:4
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)Java. Io. eofexception: broken pipeThese error messages usually
Writes an exception to the log file, you can know which exceptions the program has occurred while debugging the program, and you can know where the exception occurred. This is especially effective for programs that need to be run long and debugged.1 /// 2 ///print an exception
Encountered a problem when querying the log found that there are many files printed on the server, each of which stores a portion of the log, the log needs to be sorted by time and all logs are displayed.Original command:grep-h searchcontent */*log The search results will show all the contents in the following format:F
should knowPS grep MyServer -it myserver/bin/bash #进入自己的docker ContainerQuestion 7, other tricks?Netstat-TUNLP #查看网络端口监听情况 to determine if the server has problems PSgrep httpd #查看进程相关 pstree more vivid grep -F-F a.txt b.txt #求文件交集 sortuniq -d #求两文件交集 Sort uniq -u #求两文件不重复的项Speaking of log screening, in fact, just want to
-related issues, used only by the operating system ). Click an event in these event categories to display the event Details window. Right-click these event categories to clear the logs, save the logs, create a new log view, open the file, and set the maximum size of the log file through attributes. If the
Http://blog.sina.com.cn/s/blog_62e7fe670101dg9d.htmlLinux find a method that matches multiple keywords in GREP at a time by finding multiple specified files or excluding certain types of files(1) Linux find more than one specified file at a time:Find a.html and b.html
find.-name "a.html"-name "b.html"
Find. -regex '. *\.txt\|. *\.doc\|. *\.mp3 '
find.-regex '. *\.txt\|. *\.doc\|. *\.mp3 '
Reprint: http://blog.sina.com.cn/s/blog_62e7fe670101dg9d.html Linux find a method that matches multiple keywords in GREP at a time by finding multiple specified files or excluding certain types of files(1) Linux find more than one specified file at a time:Find a.html and b.html
Find. -name "a.html"-name "b.html"
Find. -regex '. *\.txt\|. *\.doc\|. *\.mp3 '
Find. -regex '. *\.txt\|
1, check the file under a certain path.Search for "*.log" files under/etcFind/etc-name "*.log"2, expand, List all files under a path, including subdirectories.Find/etc-name "*"3. Look for all files that contain the "Hello Abcserver" string under a path.Find/etc-name "*" | Xargs grep "Hello abcserver"or find/etc-name "*
GrepThe grep command in a Linux system is a powerful text search tool that uses regular expressions to search for text and match lines to print.Command syntax:Usage:grep [-ABCDEFGHHIIJLLMNOOQRSSUVVWXZ] [-A num] [-b num] [-c[num][-E Pattern] [-F file] [--binary-files=value] [--color=when][--context[=num]] [--directories=action] [--label] [--line-buffered][--null] [Pattern] [
1, about logging is the development of essential knowledge, now give you a detailed talk about how to record log information; the principle is not much said to see the actual operation
2, configure the log4j file: The specific configuration of what means to do not say a look at the understand Hey
Log4j.rootcategory=debug,stdlog,errorlogLog4j.appender.stdout=org.apache.log4j.consoleappenderLog4j.appender.std
Yii2.0 Chinese development wizard-custom log file write log, yii2.0 Log File
Introduce the log class to the headerUse yii \ log \ FileTarget;
$ Time = microtime (true );$
text must be written in a logical page.Each logical page has a header, a body, and a footer section (which can have an empty section).Unless you use the-P flag, the NL command re-sets the line number where each logical page begins. Row calculation flags can be set separately for header, body, and footer sections (for example, header and footer lines can be computed but text lines cannot).Usage examples:Example one: List the contents of Log2012.log wi
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.