Changeset f76390b959038f5635e9e51ab381b567ff6d78d0
- 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
| r02cf4fd |
rf76390b |
|
| 31 | 31 | |
|---|
| 32 | 32 | import org.apache.commons.logging.Log; |
|---|
| | 33 | import org.apache.commons.logging.LogFactory; |
|---|
| 33 | 34 | import org.apache.commons.logging.impl.LogFactoryImpl; |
|---|
| 34 | 35 | |
|---|
| … | … | |
| 39 | 40 | */ |
|---|
| 40 | 41 | public abstract class AbstractTickExecuter extends TickController { |
|---|
| | 42 | private static final Log log = LogFactory.getLog(AbstractTickExecuter.class); |
|---|
| | 43 | |
|---|
| 41 | 44 | private String loxpath = Configuration.getSetting("LOXPATH"); |
|---|
| 42 | 45 | private String name = ""; |
|---|
| … | … | |
| 54 | 57 | System.getProperties().setProperty("org.apache.commons.logging.Log","org.apache.commons.logging.impl.SimpleLog"); |
|---|
| 55 | 58 | |
|---|
| 56 | | Log LOG = new LogFactoryImpl().getInstance("DS2"); |
|---|
| 57 | | LOG.info("Booting DS..."); |
|---|
| | 59 | Log log = LogFactory.getLog("DS2"); |
|---|
| | 60 | log.info("Booting DS..."); |
|---|
| 58 | 61 | |
|---|
| 59 | 62 | CmdLineRequest request = new CmdLineRequest(args); |
|---|
| 60 | 63 | |
|---|
| 61 | 64 | try { |
|---|
| 62 | | new DriftingSouls(LOG, request.getParameterString("config"), false); |
|---|
| | 65 | new DriftingSouls(log, request.getParameterString("config"), false); |
|---|
| 63 | 66 | } |
|---|
| 64 | 67 | catch( Exception e ) { |
|---|
| 65 | | LOG.fatal(e, e); |
|---|
| | 68 | log.fatal(e, e); |
|---|
| 66 | 69 | throw new Exception(e); |
|---|
| 67 | 70 | } |
|---|
| … | … | |
| 97 | 100 | if( loxpath.charAt(loxpath.length()-1) != '/' ) { |
|---|
| 98 | 101 | loxpath += '/'; |
|---|
| | 102 | } |
|---|
| | 103 | if( !new File(loxpath).isDirectory() ) { |
|---|
| | 104 | log.error("Der Log-Pfad '"+loxpath+"' existiert nicht"); |
|---|
| 99 | 105 | } |
|---|
| 100 | 106 | } |
|---|
| … | … | |
| 193 | 199 | |
|---|
| 194 | 200 | 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 | } |
|---|
| 196 | 205 | } |
|---|
| 197 | 206 | |
|---|
| rc09e0ad |
rf76390b |
|
| 32 | 32 | import net.driftingsouls.ds2.server.framework.db.Database; |
|---|
| 33 | 33 | |
|---|
| | 34 | import org.apache.commons.logging.Log; |
|---|
| | 35 | import org.apache.commons.logging.LogFactory; |
|---|
| | 36 | |
|---|
| 34 | 37 | /** |
|---|
| 35 | 38 | * Basisklasse fuer Ticks |
|---|
| … | … | |
| 38 | 41 | */ |
|---|
| 39 | 42 | public abstract class TickController { |
|---|
| | 43 | private static final Log log = LogFactory.getLog(TickController.class); |
|---|
| | 44 | |
|---|
| 40 | 45 | /** |
|---|
| 41 | 46 | * Log-Ziel: Standardausgabe |
|---|
| … | … | |
| 212 | 217 | } |
|---|
| 213 | 218 | else { |
|---|
| | 219 | log.info("Fuege Log-Ziel '"+file+"' hinzu"); |
|---|
| | 220 | |
|---|
| 214 | 221 | File f = new File(file); |
|---|
| 215 | 222 | 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 | } |
|---|
| 217 | 230 | } |
|---|
| 218 | 231 | w = new FileWriter(f, append); |
|---|