Can I Disable the Creation of the "log" Directory?

#1

These are questions asked in the context of the proposed architecture described in the forum thread titled, "Sample JDO Architecture for Follow Up Questions".
 

In the objectdb.conf file (attached to forum thread mentioned above), I disable logging (by setting log path="") but the "log" directory still gets created.  A "log" directory also gets created when I run com.objectdb.Enhancer, even when it does not create output.  I must tell my version control system and product to ignore these "log" directories, which is a minor annoyance.

Can the creation of "log" directories be disabled?

 

#2

This may indicate that ObjectDB doesn't use the objectdb.conf file in which you set the log path to empty, since apparently the only place in which "log" is specified in ObjectDB as the log directory is in the objectdb.conf file.

See this manual page regarding the location of the ObjectDB configuration file.

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)
#3

Can you confirm that "log" file still gets created by this test program?

 

<objectdb>
<general>
  <temp path="$temp/ObjectDb" threshold="64mb" />
  <network inactivity-timeout="0" />
  <url-history size="0" user="false" password="false" />
  <log path="" max="8mb" stdout="false" stderr="false" />
  <log-archive path="$objectdb/log/archive/" retain="90" />
  <logger name="*" level="info" />
</general>
</objectdb>

 

import javax.jdo.JDOHelper;
import javax.jdo.PersistenceManager;
import javax.jdo.PersistenceManagerFactory;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Properties;
public class Test{
    public static void main(String[] args){
        String currentDirectory = System.getProperty("user.dir", ".");
        System.out.format("Current Directory:  %s%n", currentDirectory);
        Path objectDbConFile = Paths.get(currentDirectory, "objectdb.conf");
        if(Files.exists(objectDbConFile)) System.out.println("objectdb.config FOUND"); else System.out.println
            ("objectdb.config NOT found");
        Path logDirectory = Paths.get(currentDirectory, "log");
        if(Files.exists(logDirectory)) System.out.println("log EXISTS BEFORE TEST"); else System.out.println
            ("log does NOT exist before test");
        System.setProperty("objectdb.home", currentDirectory); // Sets %objectdb environment variable
        System.setProperty("objectdb.conf", objectDbConFile.toString());
        Properties properties = new Properties();
        properties.setProperty("javax.jdo.PersistenceManagerFactoryClass", "com.objectdb.jdo.PMF");
        properties.setProperty("javax.jdo.option.ConnectionURL", "$objectdb/local.odb");
        PersistenceManagerFactory persistenceManagerFactory = JDOHelper.getPersistenceManagerFactory(properties);
        PersistenceManager persistenceManager = persistenceManagerFactory.getPersistenceManager();
        persistenceManager.close();
        persistenceManagerFactory.close();
        if(Files.exists(logDirectory)) System.out.println("ObjectDB created log directory"); else System
            .out.println("ObjectDB did NOT create log directory");
    }
}

 

Current Directory:  C:\Users\BoydEdmondson\Documents\Programming\UniLogical\ObjectDbTest
objectdb.config FOUND
log does NOT exist before test
ObjectDB created log directory

 

#4

If a problem is confirmed and a solution is provided, will the solution also prevent the "log" directory created when running the enhancer (java ... com.objectdb.Enhancer)?

#5

Yes. It is the same code.

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)
#6

Do I need to turn this forum posting into an issue (a bug report in the Issue Tracking system)?

#7

Build 2.6.8_07 should fix this issue. Thank you for the report.

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)
#8

Confirmed.  The fix works for me.  Thanks!


Post Reply

To post a reply and/or subscribe to update notifications - please login