This is a created
article in which the information may have evolved or changed.
Code
package main import ( "log" "os")/*2016/10/20 13:25:42 Hello, 5 + 3 = 8[bar]2016/10/20 13:25:42 test.go:29: Hello, world![bar]2016/10/20 13:25:42 test.go:30: Hello, world![bar]2016/10/20 13:25:42 test.go:31: 5 + 3 = 8[bar]2016/10/20 13:25:42 test.go:33: Program will exit from here.exit status 1*/func main() { foo() bar()}func foo() { log.Println("Hello, 5 + 3 = ", 5 + 3)}func bar() {
, Messagetype.information, module); private void Log (String message, MessageType type, string module) {Trace.WriteLine ( String. Format ("{0},{1},{2},{3}", DateTime.Now.ToString ("Yyyy-mm-dd HH:mm:ss"), type. ToString (), module, message)); }} public enum MessageType {information = 0, Warning = 1, Error = 2}}Add in the App. Config file (you can also create TraceListener in your code): The use is also very simple, static void Main (string[] args
Http://blog.sina.com.cn/s/blog_5f7d1a610100ebph.htmlWrite my solution directly:Under src , create a new file named log4j.properties content as follows:# Configure logging for testing:optionally with log fileLog4j.rootlogger=warn, stdout# Log4j.rootlogger=warn, stdout, logfileLog4j.appender.stdout=org.apache.log4j.consoleappenderLog4j.appender.stdout.layout=org.apache.log4j.patternlayoutlog4j.appender.stdout.layout.conversionpattern=%d%p [%c]-%m%nLog4j.appender.logfile=org.apache.log4j.fileappend
The following error occurred while running the Java Project project several days ago: 1. First see if the file name is: Log4j.properties or log4j.xml.2. After confirming that the file location is correct, Java project needs to place the file in: Project/src/or project/Custom folder/. Put it in the top-level directory,Web Projiect need to put files in the \web-inf\classes folder.3. If there is no error, it is only to see if the file itself is wrong.The Java project configuration is as follows:
#!/user/bin/python#-*-coding:utf-8-*-" "subprocess: Need to test shelllogging on Linux platform" "ImportLogging#output The log in a file#logging.basicconfig (filename= "App.log", level=logging. DEBUG)Logging.basicconfig (filename="App.log", level=logging. WARNING, Format='% (asctime) s% (levelname) s% (filename) s:% (lineno) d-% (message) s', Datefmt='%m/%d/%y%i:%m:%s%p')#add time to the log.%p represents PM. TODO Why not hit the number of trips?Logging.debug ("Test Debug") Logging.info ("Test I
1. Difference between clustered and non clustered IndexHttp://space.exue.com/i10691.htmlIn SQL Server what's the different clustered index and non-clustered index?
A clustered index determines the physical order of data in a table. e Learning zone
How do large organizations in the top financial services enterprises adopt a large-scale scrum framework (less)?
Background
J.P Morgan's global core processing technology group, led by Simon Cooper, is an organization of more than 3,000 people
1Under SRC, create a new file named Log4j.properties content as follows: for file Log4j.rootlogger=WARN, stdout# log4j.rootlogger=WARN, stdout, logfilelog4j.appender.stdout =Org.apache.log4j.ConsoleAppenderlog4j.appender.stdout.layout=
The stack call log that causes the program to crash writes to the file for easy collection of bugs. In Debugging the Android program, for some reason the phone can not connect to the PC side, the IDE can not see the program crashed log, I hope log
Today more busy, originally wanted to write more content, temporarily no way, pick a relatively simple components to write down, the next few chapters are introduced components.
Ltlogger use or relatively simple, the basic code is in the autoloader
The Out,error in system are final type and cannot be changed. However, the new output stream can be set through SetOut (), thus enabling the ability to write logs.
Import Java.io.PrintStream; Import java.io.FileNotFoundException; public class
Copy CodeThe code is as follows:
Define global variable record time
$_timer_id = 0;
function setting global variable records the time it takes for each breakpoint to run
function Maketimer ($notes, $onOff =false)
{
if ($ONOFF)
{
Global
This is an ASP tutorial delete the specified record program code Oh, the instance by clicking Connect to delete the page, and execution deletes,
Database Tutorial ConnectionsSub Opendb ()Set Rs=server. CreateObject ("Adodb.recordset")Set
additivity= "false" >
Public String index (model model) {
logger.info ("Log Test");
return null;
}
Test results:
1, do not write the root tag, only write category tags
Output Result: Test log
2.
Really can't remember where to download the SyslogGather.exe, but my "unfinished files", there is such a file, see the name to know, is related to syslog, open the interface is very simple:
We can see that SyslogGather.exe is actually a green
Today more busy, originally wanted to write more content, temporarily no way, pick up a relatively simple components to write down, the next chapters are introduced components.
The use of Ltlogger is relatively simple, the basic code is in the
Copy CodeThe code is as follows:
Define global variable record time
$_timer_id = 0;
function to set global variables to record the time required for each breakpoint to run
function Maketimer ($notes, $onOff =false)
{
if ($ONOFF)
{
Global $_timer_id;
Web project with log4j configuration file, the results are not effective, carefully check the configuration file no problem, the results have been reportedLog4j:warn No appenders could be found for loggerFire big, so the source code down to debug,
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.