ERROR, WARN, INFO, and DEBUG, which are used to specify the importance of the log information; the log output destination specifies whether the log will be appended to the end of the execution file or the file. the output format controls the display content of the log information.1. log priority. There are four types of log information (commonly used). you can set a priority in the configuration file to display or hide debugging information in the co
First, the use of log4j.properties detailed
1. Types of output levels
ERROR, WARN, INFO, DEBUG
Error is a critical error, mainly a program
WARN for general warnings, such as session loss
Info is the general information to display, such as login log out
Debug information for the program
2. Configure the log information output destination
Log4j.appender.ap
. View the contents of the full system log buffer$ adb Logcat2. Output only logs of the specified typeLog type identifiers (priority from low to high):1. V-verbose Detailed 2. D-debug Commissioning3. I-info messages4. W-warn Warning5. E-error Error6. F-fatal Deadly7. S-silent Silent $ adb logcat *:vNote: Display the log information with priority Verbose or higher, output debug, info, Warn, Error debug infor
Modify the error level in the error log in apache2. problems may occur because writing logs will cause great losses to the system. After logging is disabled, the overall performance can be improved by nearly 40% (roughly estimated). How can this problem be solved? You can reduce log reading and writing by reducing the log level. It is worth noting that this will cause troubles for "Intrusion Detection" and other log-based analysis work. Therefore, use it with caution. 2. Solve the problem by edi
necessarily accurate). The file is modified, updated, and cached. The file is not modified and does not time out, read the cache and return results. Let's look at the source code:
Class cache {/* Class Name: cache Description: control to cache data, $ cache_out_time is a array to save cache date time out. */private $ cache_dir; private $ expireTime = 180; // The cache time is 60 seconds function _ construct ($ cache_dirname) {if (! @ Is_dir ($ cache_dirname) {if (! @ Mkdir ($ cache_dirname, 077
example, if the debug level is not added, the code in the second line does not need to generate multiple String objects in the environment (production environment) where the Debug level is disabled.
if(logger.isDebugEnabled()){ logger.debug("["+resultCount+"]/["+totalCount+"] of users are returned");}
If the parameter information method is used, even if the debug level (the first line) is not added to the judgment in the following code, the second line of code will generate only one String o
answer is the decorator.Simple decorator
Def use_logging (func): def wrapper (): logging. warn ("% s is running" % func. _ name _) return func () # When passing foo as a parameter, executing func () is equivalent to executing foo () return wrapperdef foo (): print ('I am foo') foo = use_logging (foo) # The function object wrapper returned by the decorator use_logging (foo). This statement is equivalent to foo = wrapperfoo () # executing foo () is equ
execution log of the function, so add the log code to the Code:
def foo(): print('i am foo') logging.info("foo is running")
If bar () and bar2 () functions have similar requirements, how can this problem be solved? Write another logging in the bar function? In this way, a large number of identical codes are generated. To reduce repeated code writing, we can redefine a new function to process logs and then execute the real business code after logs are processed.
def use_logging(func): logging
common-logging comes with a log implementation class.It implements the log interface. No action is made in the method of its output log.3. Using JCL developmentBecause log4j is strong, and developers do not want to be too dependent on log4j.So at present the more popular is commons-logging and log4j combination use. 1. The deployment logger downloads the Commons-logging.jar and log4j.jar packages, enabling them to be placed in the project's Lib directory and introduced into the project. 2. Spec
code is incorrectly compiled, the prompt Bug you set will be output in the Command handler:
@debug 10em + 12em;
Output:
Line 1 DEBUG: 22em
@ Warn@ WarnAnd@ DebugSimilar functions are used to help us better debug Sass. For example:
1 @mixin adjust-location($x, $y) { 2 @if unitless($x) { 3 @warn "Assuming #{$x} to be in pixels"; 4 $x: 1px * $x; 5 } 6 @if unitless($y) { 7
information is from high to low with error, WARN, INFO, DEBUG, respectively, to specify the importance of this log information; the output destination of the log information specifies whether the log will be appended to the end of the file or the file, and the output format controls the display of the log information.1. The priority of the log, the log information has four categories (commonly used), you can set the priority in the configuration file
-doctorinfo Appiumdoctor # # # Diagnostic Starting # # #info Appiumdoctor? Xcode is installed at:/applications/xcode.app/contents/developerwarn appiumdoctor? Xcode Command Line Tools is not installed!info appiumdoctor? Devtoolssecurity is Enabled.info appiumdoctor? The Authorization DB is set up Properly.info appiumdoctor? The node. JS binary was found at:/usr/local/bin/nodeinfo appiumdoctor? HOME is set to:/users/macbookwarn appiumdoctor? Android_home is not set!
/usr/local/bin/node/usr/local/lib/node_modules/npm/bin/npm-cli.js Install-- Scripts-prepend-node-path=auto npm WARN deprecated [emailprotected]: Use the built-in module in node 9.0.0 or newer, instead NPM WARN deprecated [emailprotected]: Please update to Minimatch 3.0.2 or higher to avoid A RegExp DoS issue npm WARN deprecated [emailprotected]: Redos vulnera
About logging, if you do not want to use with the write, and do not want to use log4net words, perhaps you can understand this!I am also a very lazy person, the program of things, as long as others have written, and their own use of cool, do not repeat the coding. The origin of this component is because feeling log4net too strong too complex (for me really), when I want to use log4net, I see the configuration I have to scare the urine n times, and this time heart and whim, with HTML to do the pe
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.