Switch to full style
General Java code examples
Post a reply

Create a Custom Log in java

Tue Nov 11, 2008 11:00 pm

Code:
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 strint val){
    
super(strval);
  }


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.



Post a reply
  Related Posts  to : Create a Custom Log in java
 Create Custom Filters For JFileChooser!!!!     -  
 Create Custom Brushes in Photoshop     -  
 Image Custom Filter In Java     -  
 create Animation in java     -  
 Create a firewall project in java     -  
 create Sparse Matrix in java     -  
 Create set up file of my java application     -  
 how to create a photo management system using java     -  
 How to create a file in java script using FireFox     -  
 How to create Email from Core Java Code     -  

Topic Tags

Java Files and I/O