Store preferences in user home directory

If you think LogMX needs a new useful feature!
Post Reply
isheedm
Posts: 109
Joined: Wed Sep 12, 2007 2:16 pm

Store preferences in user home directory

Post by isheedm » Thu Oct 11, 2012 9:56 pm

I have a UNIX workstation and it would make it much easier to do upgrades if you store all preferences in the user's home directory. Typically, the software is installed as "root" without write privileges to the config/ directory. After installing LogMX, we have to remember to open up the write permissions on the config/ directory so the preferences can be saved. It also complicates upgrades by having to copy those files into the new installation.

You could deliver a set of default preference files in config/, but on save, write them to the user's home directory. On startup, you check the user's home directory first, then if preference files aren't present, read the ones out of the LogMX installation directory.

For reference, the Java "user.home" property works on Windows and UNIX equally well:
String home = System.getProperty("user.home");

admin
Site Admin
Posts: 418
Joined: Sun Dec 17, 2006 10:30 pm

Re: Store preferences in user home directory

Post by admin » Mon Dec 10, 2012 5:57 pm

Hello,

Sorry for this late answer, the forum e-mail notification seems to had some problems...

You're right, we will add such a feature in a future release.
In the meantime, here is a way to perform this (a bit more complicated): you can start LogMX with the "--conf" option to specify a new location for "startup.conf" file:

Code: Select all

logmx --conf="/home/john/LogMX/my_startup_file.conf"
Then, in this "startup.conf" file, use option "CONFIG_FILE" to specify a new location for "logmx.properties" file:

Code: Select all

CONFIG_FILE=/home/john/LogMX/logmx.properties
Using an alias to always start LogMX with "--conf" should make it transparent ;-)

Xavier

isheedm
Posts: 109
Joined: Wed Sep 12, 2007 2:16 pm

Re: Store preferences in user home directory

Post by isheedm » Mon Dec 10, 2012 8:37 pm

Thanks for the update. I noticed the change in the latest version and it does help a lot.

Post Reply