Changeset 21925 for main/trunk


Ignore:
Timestamp:
2010-04-20T15:51:41+12:00 (14 years ago)
Author:
sjm84
Message:

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

File:
1 edited

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;
Note: See TracChangeset for help on using the changeset viewer.