Changeset 21925

Show
Ignore:
Timestamp:
20.04.2010 15:51:41 (9 years ago)
Author:
sjm84
Message:

The logger now creates the log file if it does not exist

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/src/java/org/greenstone/admin/LoggedMessageArea.java

    r21922 r21925  
    1616    { 
    1717    if(!_loggingLoaded){ 
     18        try{ 
     19        File logPath = new File(".." + File.separatorChar + "ext" + File.separatorChar + "logs"); 
     20        File logFile = new File(".." + File.separatorChar + "ext" + File.separatorChar + "logs" + File.separatorChar + "ext.log"); 
     21     
     22        if(!logPath.exists()){ 
     23            logPath.mkdirs(); 
     24        } 
     25 
     26        if(!logFile.exists()){ 
     27            logFile.createNewFile(); 
     28        } 
     29        } 
     30        catch(Exception ex){ 
     31        ex.printStackTrace(); 
     32        } 
    1833        PropertyConfigurator.configure("log4j.properties"); 
    1934        _loggingLoaded = true;