Hello Andreas,
Yes, the example with the features file (org.apache.karaf.features.cfg)
doesn't work but should.
I'm not sure what the log.cfg and the custom.settings files are. However, I
do this in my org.ops4j.pax.logging.cfg:
log4j.appender.info.file=${logdir}/info.log
And I put this in the custom.properties:
logdir=data/log
I use that mechanism in several configuration files, e g:
- org.ops4j.pax.web.cfg
- org.apache.karaf.management.cfg
- org.apache.karaf.shell.cfg
The above gives me the possiblitly to manage all the ports in one place
(custom.properties) - which is very convenient.
But for some reason this mechanism doesn't work
for org.apache.karaf.features.cfg.
/Bengt
2012/12/13 Andreas Pieber <[email protected]>
> well, checking the code I would say there's no difference to the other
> .cfg files. I'm even not sure if it's a bootstrap error. How exactly can I
> reproduce the problem?
>
> in the features file:
> featuresRepositories = ${var}
>
> and in custom.properties
> var =
> "mvn:org.apache.karaf.features/standard/3.0.0-SNAPSHOT/xml/features,mvn:org.apache.karaf.features/enterprise/3.0.0-SNAPSHOT/xml/features,mvn:org.apache.karaf.features/spring/3.0.0-SNAPSHOT/xml/features"
>
> this shouldn't work, but e.g.
>
> in log.cfg
> pattern = ${abc}
>
> and in custom.settings
> abc = "%d{ISO8601} | %-5.5p | %-16.16t | %-32.32c{1} | %X{bundle.id} - %X{
> bundle.name} - %X{bundle.version} | %m%n"
>
> works?
>
> Kind regards,
> Andreas
>
>
>
> On Thu, Dec 13, 2012 at 8:22 AM, Bengt Rodehav <[email protected]> wrote:
>
>> What I've tried to do in org.apache.karaf.features.cfg works with other
>> configuration files. File install does support this. It's the way I handle
>> most of my tailored configurations in my custom server.
>>
>> However, there seem to be something special
>> with org.apache.karaf.features.cfg since the same mechanisms dont work
>> there. That's why I wondered whether file install was used for installing
>> the "features" feature or if it was done by some other means. Could it be a
>> bootstrap problem?
>>
>> /Bengt
>>
>>
>> 2012/12/12 Andreas Pieber <[email protected]>
>>
>>> Hey,
>>>
>>> I'm afraid this is currently not really possible. The custom.properties
>>> is written into the System.setProperty while the fileinstall (but I've only
>>> checked the code only shortly) does not access this sort. I think to make
>>> this available would require a patch to fileinstall.
>>>
>>> @Everybody with more knowhow about the fileinstall internals: feel free
>>> to correct me :-)
>>>
>>> Kind regards,
>>> Andreas
>>>
>>>
>>> On Tue, Dec 11, 2012 at 10:42 AM, Bengt Rodehav <[email protected]>wrote:
>>>
>>>> I have a use case where I want to move the list of boot features (the
>>>> "featuresBoot" property) from "org.apache.karaf.features.cfg" into
>>>> "custom.properties". The reason is that our custom server comes with a
>>>> great number of features but each customer only uses some of them. To allow
>>>> for easy customisation (and upgrades) I put everything related to a
>>>> specific installation in a custom.properties file (that I put outside the
>>>> Karaf home directory). I can then easily see how this installation is
>>>> customised and I can easily upgrade by simply replacing the entire Karaf
>>>> installation and keep the customisation (since it is located outside
>>>> Karaf).
>>>>
>>>> However, it seems I cannot use variables defined in "custom.properties"
>>>> in "org.apache.karaf.features.cfg". In fact, I cannot even define a
>>>> variable in "org.apache.karaf.features.cfg" and then use it in the same
>>>> file.
>>>>
>>>> How come? Isn't FileInstall used for
>>>> parsing "org.apache.karaf.features.cfg"?
>>>>
>>>> How can I use custom variables in "org.apache.karaf.features.cfg"?
>>>>
>>>> I use Karaf 2.3.0 with Java 6 on Windows 7.
>>>>
>>>> /Bengt
>>>>
>>>
>>>
>>
>