Home | Ajax | BioInformatics | Dojo | EAI | EJB | Hibernate | J2ME | Java | Java Glossary | Java Servlets | JavaScript | Jboss | JDBC | JDO | Jmeter | JSF | JSP | JUnit | Maven | MySQL | Spring Framework | SQL | Struts | Technology | WAP | Web Services | XML


 
  
 
Programming Tutorials: Ajax | Articles | JSP | Bioinformatics | Database | Free Books | Hibernate | J2EE | J2ME | Java | JavaScript | JDBC | JMS | Linux | MS Technology | PHP | RMI | Web-Services | Servlets | Struts | UML
 

 
Facing Programming Problem?
Ask Questions?, Browse Latest Questions, Question-Answer Guidelines
Java
  JDO Tutorials
  EAI Articles
  Struts Tutorials
  Java Tutorials
  Java Certification
  Java Applet
Questions
Comments

Create a Custom Log Level in Java

                         

This section tells you how to create a custom log level that means log levels are created by users for own need. Java logging class provides some levels like: INFO, WARNING, SEVERE, FINEST etc. See brief information about the topic and an example for the best illustration the procedure of creating a custom log level in Java, is given as ahead.

Descriptions of program:

This program creates a logger and the CustomLevel class extends the Level class for constructing a custom log level. All levels have an unique value. Similarly, the custom log level has an unique value  which is retrieved by the intValue() method. 

Descriptions of code:

level.parse(String message):
Above method takes string type value that has parsed into a level.

Here is the code of program:

import java.util.logging.*;

public class CustomLevel extends Level{
  public static void main(String[] args) {
    Logger log = Logger.getLogger("RoseIndia.Net");
    Level level1 = Level.WARNING;
    int num = level1.intValue();
    Level level = new CustomLevel("RoseIndia Level", num);
    Level clevel = level.parse("RoseIndia Level");
    log.log(clevel, "This is a Custom Level");
  }
  public CustomLevel(String str, int val){
    super(str, val);
  }
}

Download this example.

                         

Leave your comment:

Name:

Email:

URL:

Title:

Comments:


Enter Code:

Audio Version
Reload Image
 

Note: Emails will not be visible or used in any way, and are not required. Please keep comments relevant. Any content deemed inappropriate or offensive may be edited and/or deleted.

No HTML code is allowed. Line breaks will be converted automatically. URLs will be auto-linked. Please use BBCode to format your text.

Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Latest Searches:
WHERE Statement in SQL
factory method
username and password
Photoshop Animation An
java jtable
permutation
JDBC with Mysql in Ecl
multiple submit button
Button
data ware
oracle.jdbc.driver.Dat
server side validation
draw Polyline
web.xml file
convert string to stin
breakั?�??????ั?
org.gjt.mm.mysql.Drive
compare java.util.date
struts formfile
JavaWorld article abou
Photoshop Basics Using
logout session
system.out.println(x
data binding
program to find greate
project in session bea
ant script web and ejb
select from statment
writing data to file
panelgrid colspan
jdbc connections
intranet applications
Exercise - Pad Left
example for org.jfree.
Delete database
XML Class Constructor
Passing Parameters in
Display detailed cloc
Reading Nested dom ele
swt
page refresh
Add a file finder
Refresh a Web Page Usi
Build scripts with Gro
DOM
hibernate findall
insert fields blob
count row in resultset
token string
java programs usin pus
mysql blob
Insert an array list o
javabean program
Merge Sort In Javascri
write a program to tes
java applets
x509
connect a program writ
extract
Create XML file from f
lucene
Two Dimensional Array
file input output
HSSF clone cell
interview question
JSF 2
FileInputStream
code for how connect j
hibernate many to many
source code for chat p
set()mutator method
Tree Grid using flex
?���??���?
techiques to use subst
Photoshop Textures and
abstract
flex tutorial
jsp servlet basics
highlighting and dehig
j2me combo example
Java String toLowerCase Example
Java String toCharArray Example
Java String substring Example
Java String indexOf Example
Java String startsWith Example
Java String hashCode Example
Java String matches Example
Java String length Example
Java String lastIndexOf Example
Java String isEmpty Example
Java String equalsIgnoreCase Example
Java String equals Example
Java String endsWith Example
Java String copyValueOf Example
Java String contentEquals Example
  EAI Articles
  Java Certification
Tell A Friend
Your Friend Name
Search Tutorials

 

 
 
Browse all Java Tutorials
Java JSP Struts Servlets Hibernate XML
Ajax JDBC EJB MySQL JavaScript JSF
Maven2 Tutorial JEE5 Tutorial Java Threading Tutorial Photoshop Tutorials Linux Technology
Technology Revolutions Eclipse Spring Tutorial Bioinformatics Tutorials Tools SQL
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net  | Site Map

India News

Indian Software Development Company | iPhone Development Company in India | Java Training Delhi | Java Training at Noida |

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2008. All rights reserved.