The logging component that behaves as HTML

Source: Internet
Author: User

About logging, if you do not want to use with 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 write well, and their own use of cool, never do repeat coding. The origin of this component is because it feels log4net too strong and too complex (for me really), when I want to use log4net, see configuration I have to frighten urine n times, and this time the heart and whim, with HTML to do log performance! The reason is two, one is HTML and CSS everyone will, the second is to achieve a very good readable visibility.

I. Description of the configuration file

<?xml version= "1.0" encoding= "Utf-8"?> <LoggerConfig> <style> fatal{background-color:red
    }. error{Background-color:purple;
    }. warn{Background-color:yellow;
    }. info{Background-color:green;
    }. debug{Background-color:gray;
    }. myinfo{font-size:24px; } </style> <tpls> <tpl name= "Fatal" > <!
        [cdata[<p> <span class= "fatal" >{type}</span>:{message}<br/> {Date} </p>]]> </tpl> <tpl name= "error" > <!
        [cdata[<p> <span class= ' error ' >{type}</span>:{message}<br/> {date} </p>]]> </tpl> <tpl name= "warn" > <!
        [cdata[<p> <span class= "warn" >{type}</span>:{message}<br/> {Date} </p>]]&GT </tpl> <tpl name= "info" > <!
        [cdata[<p> <span class= "info" >{type}</span>:{message}<br/> {Date} </p>]]> </tpl> <tpl name= "Debug" > <!
        [cdata[<p> <span class= ' Debug ' >{type}</span>:{message}<br/> {date} </p>]]> </tpl> </tpls> <logs> <log name= "Default" Path= "D:\ab C "types=" All "datefmt=" Yyyy-mm-dd HH:mm:ss "> <tpl name=" info "> <! [cdata[<p> <span class= "info myinfo" >{type}</span>:{message}<br/> {D  ATE} </p>]]> </tpl> </log> <log name= "log2" path= "D:\abc\a.html" types= "Fatal,error,warn,info,debug" > </log> </logs> </LoggerConfig> loggerconfig.xml

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.