where sould the properties file be placed ? Also how should it look like in terms of properties., descriptions and possible variables ?
Thanks in advance...
the properties file should be in the jar. This is done different depending on which IDE or development environment you use. Could you please describe your environment? If so, I could maybe give you a hint on how to do it. Please notice that it is also possible to set the values in the JAD file. The JAD file is the first place where Microlog looks for the settings.
The presentation below contains a good description on how to setup Microlog. This is valid for Microlog V1.1.1, although it was prepared for v0.4.3.1
There is a microlog.properties file included which could give you some hint on how the properties look like as well.
Last but not least, there is a quick start guide:
Please do not hesitate to ask anything more, if you still have problems.
Yes I saw the quick-start but, not to be unthankfull, it's a little too short and not very specific... like it mentions a properties file, but it doesnt say where it is, nor I cant find any of the parameters specifications... Or lets say, I assume there are several parameters within that properties file which can be set up, and if so it would be nice to have some sort of documentation which tells us what those parameters do and more importantly with which values these can be set (in the worst case scenario you have been using some kind of words (strings) as values, which leaves us guessing to what other logical words may have been used as alternative values)...
I;d like to apologize right away if all the information I am talking about is allready within the properties file, till now I haven't been able to find it, so I couldn't check it out for myself...
anyways, I am using NetBeans 6.1 and 6.5, and I am using the source code instead of the jar, mostly so that I could remove all S3 components to minimize JAR size after compiling...
the quick start guide is only to get developers to really getting started, not to explain the properties in detail. I know that it is a problem that there is not one place that describe the properties. I guess that you use V1.1.1. If so you could look at the constants defined in the appender that you are using and the formatter as well.
Since I know this is a problem, I have tried to solve this in V2.0 by gathering all the properties in one place. All the properties are in the PropertyKeys file.
When I get time I will try to describe all the properties in one place, in one document. That is on my todo list, but is not of highest priority right now.
I hope that you will be able to solve your problems right now by looking at the constants in the files.
The "big" jar is broken down to smaller jars in V2.0.
Could you help me detect what correct properties shall I put to microlog.properties file to setup logger. At that moment I want to write log to exact file. So I have use next properties:
Instead of "ExampleFileLog.txt" I have received microlog.txt - it is default file name. So I suppose this microlog.core.appender.FileAppender.fileName is incorrect one property.
Could you help to resolve this issue plus btw please publish all available properties which can be setup via microlog.properties.
Thanks in advance
the correct property should be
I plan to publish a list of all the properties as part of the final 2.0 release. As it is now the implementation is a little bit in flux and is subject to changes.
Thanks for the answer.
But microlog.core.appender.FileAppender.filename doesn't help. I used also microlog.appender.FileAppender.filename as defined in PropertyKeys.java, but it also doesn't work. I received default file name - microlog.txt. Also I have checked whether microlog.properties is in microlog jar file as you described above, but it is absent.
I use microlog 2.0. And to read properties from file I call PropertyConfigurator.configure();
Please help me to fix this problem
Another question. I use microlog 2.0 and I'd like to write log to the file. When application was staring I received system request like "Allow application to read/write user data?" when I selected Yes - everything worked and log went to the file.
But when I selected No - I received "Unhandled exception. Close application?"
Can you advice how to fix this problem.
I advise you to answer yes if you want to write to file. There is no way around this problem if you do not have a certificate to sign your MIDlet/application. The "Unhandled exception" is a problem in Microlog, but nothing to worry about.
the problem with the microlog.appender.FileAppender.filename is actually my bad. It is now fixed in the Subversion repository. It will be included in the 2.0.0 final release. Expect this to be released soon.
After analyzing the code I understand that this property should be "microlog.appender.filename" and it works. Can you tell me what date 2.0.0 will be released?
I plan to release it before end of the week.
Glad that you found the workaround! :)
at first thank you for this great peace of code!
During playing around with the library, I went into problems related to configuring the microlog lib.
As far as I understood, the microlog will use settings in JAD file also (preferred, if I understood right).
But whatever I do, microlog does only take settings from 'microlog.properties' file, or defaults if this file does not exists.
In the PDF you mentioned the ability to configure it via 'Properties properties = new Properties(this);' but the code you mentioned does not work (there is no such public interface in the logger class, as far I have seen).
So, maybe you can describe the steps required to make the API using settings in JAD file also?
(Btw. I am using Netbeans IDE 6.8 - and I came from the C++ world, so please be patient with me…)
It should compile with PropertyConfigurator.configure();
In this case the microlog.properties file is used.
There are examples:
For the JAD problem Johan must help. I guess this was possible in an earlier verison. Now the log4j style is prefered.
you should try the MidletPropertyConfigurator class to do this.
thank you for your help!
The library is great an so are you - please continue with this piece of great software.
thanks again for responding!
Johan, sorry for being clueless but I can't figure out how MIDletPropertyConfigurator does help me with the JAD files.
As far as I understood, MIDletPropertyConfigurator is related to JAR but not to JAD files, right?
Or do I mess up something?
Log in to post a comment.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.