think of log4net. Indeed, they are similar in many places, and they all adopt the hierarchical record method. I think sails is more convenient to use, it does not require us to do more things, but directly sails. log. level ("your log Content"). You don't need to worry about the singleton or persistence mode. The log of Sails is only for the console. A supplement to log can be understood as the console after the class is divided. log, which is distinguished by colors.
1. Let's take a look at th
, INFO, WARN, error, and fatal, when the output, only the level of higher than the level specified in the configuration of the information can be true output, so it is convenient to configure different circumstances to output the content, Without the need to change the code, this is really convenient.
a). Acquisition or creation of logger objects
The logger is designated as an entity and is identified by the name of a string class. The name of the lo
.
Type:help for more information.
15/11/16 13:22:37 WARN metricssystem:using default name Dagscheduler for source because spark.app.id are not set. Spark context available as SC. 15/11/16 13:22:39 WARN CONNECTION:BONECP specified but not present in CLASSPATH (or one of dependencies) 15/11/16 13:22:39 WARN CONNECTION:BONECP specified but not present in CLASSPATH (
will reference the Model, that is, the data persistence mechanism, to perform the curd operation on the data table, coming soon...
Ps: Node. js and Sails ~ Log Mechanism
When you see the logs of Sails, you will think of log4net. Indeed, they are similar in many places, and they all adopt the hierarchical record method. I think sails is more convenient to use, it does not require us to do more things, but directly sails. log. level ("your log Content"). You don't need to worry about the singleto
First, IntroductionLOG4J is an Apache open source project, through the use of log4j, we can control the log information delivery destination is the console, files, GUI components, even the socket server, NT Event recorder, UNIX syslog daemon, etc. We can also control the output format of each log, and by defining the level of each log information, we can control the log generation process more carefully.LOG4J consists of three important components: the priority of the log information, the output
log4j Introduction log4j has three main components: loggers (Logger), appenders (output source), and layouts (layout). This can be simply understood as the log category, where the logs are to be exported and how the logs are exported. The combined use of these three components makes it easy to record the type and level of information, and to control the style and location of the log output at run time. 1, the Loggersloggers component is divided into five levels in this system: DEBUG, INFO,
First, IntroductionLOG4J is an Apache open source project, through the use of log4j, we can control the log information delivery destination is the console, files, GUI components, even the socket server, NT Event recorder, UNIX syslog daemon, etc. We can also control the output format of each log, and by defining the level of each log information, we can control the log generation process more carefully.LOG4J consists of three important components: the priority of the log information, the output
There are a number of warnings available in Delphi xe2 that are not very well known ented. While you can control them in the Project Options dialog, and you can turn them on using
{$ Warn} Directives or in command line compiler options, the documentation for the warning identifiers is currently pretty piecemeal, and there is no clear link between the project options, warning directive identifiers, and numeric identifiers.
The{$
public
static final Logger with current class Logger = Logger.getlogger ("test");
public void Useradd () {
//omitted content ...
}
}
3. Add the log output code to the business code
Depending on the importance of the log information in the system, select different levels of the Logger object to record, log4j will enter the corresponding log according to the log level configured in the configuration file (log4j.properties).
public void Useradd () {
logger.debug ("Log de
, such as Log4j-1.**.jar.
Let's take the following code as an example:
Import Org.slf4j.Logger;Import Org.slf4j.LoggerFactory;
public class Slf4jdemo {private static final Logger LOG = Loggerfactory.getlogger (Slf4jdemo.class);
public static void Main (string[] args) {
log.error ("Error message!");
Log.warn ("Warn message!");
Log.info ("info message!");
Log.debug ("Debug message!");
Log.trace ("Trace message!");
}
}Because of the
Log4j is an open source project for Apache, by using log4j, we can control the destination of log information delivery is console, file, GUI component, even interface server, NT Event recorder, UNIX syslog daemon, etc. We can also control the output format of each log, and by defining the level of each log information, we can control the log generation process more carefully.
Log4j is composed of three important components: priority of log information, output destination of log information, a
Due to the need to manually install SBT for the first time, networking is required, so the network adapter mode of the virtual machine is set to "bridge mode" so that it can be connected to the Internet.However, when the "Spark-shell--master yarn--deploy-mode Client" command is executed, it cannot be started and remains in the middle State,As follows:[Email protected] test_code]# Spark-shell--master yarn--deploy-mode ClientSetting default log level to "WARN
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.