Changeset f76390b959038f5635e9e51ab381b567ff6d78d0

Show
Ignore:
Timestamp:
06/28/08 13:51:37 (3 months ago)
Author:
Christopher Jung <bktheg@web.de>
git-committer:
Christopher Jung <bktheg@web.de> 1214653897 +0200
git-parent:

[1bca9d589a36cc6e202ca2f0e977f47b19627754]

git-author:
Christopher Jung <bktheg@web.de> 1214653897 +0200
Message:

[feature] Fehlerbehandlung des Ticks verbessert

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/net/driftingsouls/ds2/server/tick/AbstractTickExecuter.java

    r02cf4fd rf76390b  
    3131 
    3232import org.apache.commons.logging.Log; 
     33import org.apache.commons.logging.LogFactory; 
    3334import org.apache.commons.logging.impl.LogFactoryImpl; 
    3435 
     
    3940 */ 
    4041public abstract class AbstractTickExecuter extends TickController { 
     42        private static final Log log = LogFactory.getLog(AbstractTickExecuter.class); 
     43         
    4144        private String loxpath = Configuration.getSetting("LOXPATH"); 
    4245        private String name = ""; 
     
    5457                System.getProperties().setProperty("org.apache.commons.logging.Log","org.apache.commons.logging.impl.SimpleLog"); 
    5558                 
    56                 Log LOG = new LogFactoryImpl().getInstance("DS2"); 
    57                 LOG.info("Booting DS..."); 
     59                Log log = LogFactory.getLog("DS2"); 
     60                log.info("Booting DS..."); 
    5861                 
    5962                CmdLineRequest request = new CmdLineRequest(args); 
    6063                 
    6164                try { 
    62                         new DriftingSouls(LOG, request.getParameterString("config"), false); 
     65                        new DriftingSouls(log, request.getParameterString("config"), false); 
    6366                } 
    6467                catch( Exception e ) { 
    65                         LOG.fatal(e, e); 
     68                        log.fatal(e, e); 
    6669                        throw new Exception(e); 
    6770                } 
     
    97100                if( loxpath.charAt(loxpath.length()-1) != '/' ) { 
    98101                        loxpath += '/'; 
     102                } 
     103                if( !new File(loxpath).isDirectory() ) { 
     104                        log.error("Der Log-Pfad '"+loxpath+"' existiert nicht"); 
    99105                } 
    100106        } 
     
    193199                 
    194200                if( !new File(loxpath+"/"+ticknr).isDirectory() ) { 
    195                         new File(loxpath+"/"+ticknr).mkdir(); 
     201                        boolean result = new File(loxpath+"/"+ticknr).mkdir(); 
     202                        if( !result ) { 
     203                                log.error("Kann Verzeichnis '"+loxpath+"/"+ticknr+"' nicht anlegen"); 
     204                        } 
    196205                } 
    197206                 
  • src/net/driftingsouls/ds2/server/tick/TickController.java

    rc09e0ad rf76390b  
    3232import net.driftingsouls.ds2.server.framework.db.Database; 
    3333 
     34import org.apache.commons.logging.Log; 
     35import org.apache.commons.logging.LogFactory; 
     36 
    3437/** 
    3538 * Basisklasse fuer Ticks 
     
    3841 */ 
    3942public abstract class TickController { 
     43        private static final Log log = LogFactory.getLog(TickController.class); 
     44         
    4045        /** 
    4146         * Log-Ziel: Standardausgabe 
     
    212217                } 
    213218                else { 
     219                        log.info("Fuege Log-Ziel '"+file+"' hinzu"); 
     220                         
    214221                        File f = new File(file); 
    215222                        if( !f.exists() ) { 
    216                                 f.createNewFile(); 
     223                                try { 
     224                                        f.createNewFile(); 
     225                                } 
     226                                catch( IOException e ) { 
     227                                        log.error("Kann Log-Ziel '"+file+"' nicht erstellen", e); 
     228                                        throw e; 
     229                                } 
    217230                        } 
    218231                        w = new FileWriter(f, append);