I'm trying to setup use my own properties file (placed under /res/microlog.properties in EclipsME to be automatically placed in the root of the jar during packaging). But, after packaging by EclipseME the default microlog.properties from MicroLogV0.5.0.2.jar/META-INF/ lies in the root of my midlet jar file.
Am I suppose to use PropertyFile myself or how?
A short example would be very useful. I currently use:
TeslanTester.log = Logger.getLogger();
final Properties properties = new Properties(this);
TeslanTester.log.configure(properties);
Also, information on how to change the RecordStore name would be neat. A nice solution would be to default to the name of the midlet.
Regards,
Jimisola
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
we currently have an issue that the example properties is packaged with the jar file. The result is that the user defined microlog.properties file is overwritten when packaging. The workaround could be to open the MicroLog0.5.0.2.jar file in winzip and delete the microlog.properties file.
If you would like to set the recordstore name in the microlog.properties file you use the following property:
microlog.appender.RecordStoreAppender.recordStoreName
I have also added propert methods to set the recordstore name. This will be included in the next release.
It is a nice suggestion that the recordstore name is the name of the MIDlet.
Regards
Johan
// MicroLog admin
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
..will the next release have an API that allows to load properties from a file other than 'microlog.properties' and to use these properties for configure() ? It would be great to be able to have different files that get loaded depending on the context (development, deployed to 'production').
Cheers,
Diego
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Perhaps it would be better for the RecordStore to be named after the Midlet-Name with an additional suffix or prefix (e.g. "MyMidlet-Log" or "MyMidlet-ml"). This to limit the risk of using a RecordStore name that the midlet is already using.
Regards,
Jimisola
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
the new code is checked in. I have decided to use "-ml" as the suffix. Since the limit of the recordstore name is 32 characters, the midlet name must not be longer than 29 characters. If the name is longer, the default name is used instead.
Best Regards
Johan
// admin
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi!
I'm trying to setup use my own properties file (placed under /res/microlog.properties in EclipsME to be automatically placed in the root of the jar during packaging). But, after packaging by EclipseME the default microlog.properties from MicroLogV0.5.0.2.jar/META-INF/ lies in the root of my midlet jar file.
Am I suppose to use PropertyFile myself or how?
A short example would be very useful. I currently use:
TeslanTester.log = Logger.getLogger();
final Properties properties = new Properties(this);
TeslanTester.log.configure(properties);
Also, information on how to change the RecordStore name would be neat. A nice solution would be to default to the name of the midlet.
Regards,
Jimisola
Hi,
we currently have an issue that the example properties is packaged with the jar file. The result is that the user defined microlog.properties file is overwritten when packaging. The workaround could be to open the MicroLog0.5.0.2.jar file in winzip and delete the microlog.properties file.
If you would like to set the recordstore name in the microlog.properties file you use the following property:
microlog.appender.RecordStoreAppender.recordStoreName
I have also added propert methods to set the recordstore name. This will be included in the next release.
It is a nice suggestion that the recordstore name is the name of the MIDlet.
Regards
Johan
// MicroLog admin
Hi!
I've added a bug report for the microlog.properties file issue: https://sourceforge.net/tracker/index.php?func=detail&aid=2072265&group_id=138008&atid=739751
Regards,
Jimisola
Now if we ignore this bug for a moment:
..will the next release have an API that allows to load properties from a file other than 'microlog.properties' and to use these properties for configure() ? It would be great to be able to have different files that get loaded depending on the context (development, deployed to 'production').
Cheers,
Diego
Hi,
I am currently working on this. This will be checked in during the day.
BTW the bug is removed. The default name for the recordstore is now the name of the MIDlet ("MIDlet-Name").
Best Regards
Johan
Johan,
Perhaps it would be better for the RecordStore to be named after the Midlet-Name with an additional suffix or prefix (e.g. "MyMidlet-Log" or "MyMidlet-ml"). This to limit the risk of using a RecordStore name that the midlet is already using.
Regards,
Jimisola
Excellent, great work ! Thanks :-)
Diego
Hi,
I will implement this as soon as possible.
Best Regards
Johan
// MicroLog admin
Hi,
the new code is checked in. I have decided to use "-ml" as the suffix. Since the limit of the recordstore name is 32 characters, the midlet name must not be longer than 29 characters. If the name is longer, the default name is used instead.
Best Regards
Johan
// admin