[JIRA] Created: (LBCLASSIC-278) Give access to environment variables in configuration file

Give access to environment variables in configuration file ---------------------------------------------------------- Key: LBCLASSIC-278 URL: http://jira.qos.ch/browse/LBCLASSIC-278 Project: logback-classic Issue Type: New Feature Reporter: Alexandre Garnier Assignee: Logback dev list It would be very nice to be able to access environment variables in configuration files. Maybe like in ant with <property environment="env"/> and then ${env.PATH} to access variable. In my use case, it's necessary to get the path to the property file to load... -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira

[ http://jira.qos.ch/browse/LBCLASSIC-278?page=com.atlassian.jira.plugin.syste... ] Alexandre Garnier commented on LBCLASSIC-278: --------------------------------------------- It's more a logback-core issue but I can't move it.
Give access to environment variables in configuration file ----------------------------------------------------------
Key: LBCLASSIC-278 URL: http://jira.qos.ch/browse/LBCLASSIC-278 Project: logback-classic Issue Type: New Feature Reporter: Alexandre Garnier Assignee: Logback dev list
It would be very nice to be able to access environment variables in configuration files. Maybe like in ant with <property environment="env"/> and then ${env.PATH} to access variable. In my use case, it's necessary to get the path to the property file to load...
-- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira

[ http://jira.qos.ch/browse/LBCLASSIC-278?page=com.atlassian.jira.plugin.syste... ] Alexandre Garnier commented on LBCLASSIC-278: --------------------------------------------- I'll try to hack it in my fork on GitHub.
Give access to environment variables in configuration file ----------------------------------------------------------
Key: LBCLASSIC-278 URL: http://jira.qos.ch/browse/LBCLASSIC-278 Project: logback-classic Issue Type: New Feature Reporter: Alexandre Garnier Assignee: Logback dev list
It would be very nice to be able to access environment variables in configuration files. Maybe like in ant with <property environment="env"/> and then ${env.PATH} to access variable. In my use case, it's necessary to get the path to the property file to load...
-- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira

[ http://jira.qos.ch/browse/LBCORE-212?page=com.atlassian.jira.plugin.system.i... ] Ceki Gulcu moved LBCLASSIC-278 to LBCORE-212: --------------------------------------------- Project: logback-core (was: logback-classic) Key: LBCORE-212 (was: LBCLASSIC-278)
Give access to environment variables in configuration file ----------------------------------------------------------
Key: LBCORE-212 URL: http://jira.qos.ch/browse/LBCORE-212 Project: logback-core Issue Type: New Feature Reporter: Alexandre Garnier Assignee: Logback dev list
It would be very nice to be able to access environment variables in configuration files. Maybe like in ant with <property environment="env"/> and then ${env.PATH} to access variable. In my use case, it's necessary to get the path to the property file to load...
-- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira

[ http://jira.qos.ch/browse/LBCORE-212?page=com.atlassian.jira.plugin.system.i... ] Ceki Gulcu commented on LBCORE-212: ----------------------------------- Accessing environment variables could probably be quite useful. However, I don't see the point in parametrize the prefix for accessing environment variables. Let's just have it fixed to "env.". The substVars method in the ch.qos.logback.core.util.OptionHelper class seems like the correct location for adding support environment variables.
Give access to environment variables in configuration file ----------------------------------------------------------
Key: LBCORE-212 URL: http://jira.qos.ch/browse/LBCORE-212 Project: logback-core Issue Type: New Feature Reporter: Alexandre Garnier Assignee: Logback dev list
It would be very nice to be able to access environment variables in configuration files. Maybe like in ant with <property environment="env"/> and then ${env.PATH} to access variable. In my use case, it's necessary to get the path to the property file to load...
-- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira

[ http://jira.qos.ch/browse/LBCORE-212?page=com.atlassian.jira.plugin.system.i... ] Ceki Gulcu reassigned LBCORE-212: --------------------------------- Assignee: Ceki Gulcu (was: Logback dev list)
Give access to environment variables in configuration file ----------------------------------------------------------
Key: LBCORE-212 URL: http://jira.qos.ch/browse/LBCORE-212 Project: logback-core Issue Type: New Feature Reporter: Alexandre Garnier Assignee: Ceki Gulcu
It would be very nice to be able to access environment variables in configuration files. Maybe like in ant with <property environment="env"/> and then ${env.PATH} to access variable. In my use case, it's necessary to get the path to the property file to load...
-- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira

[ http://jira.qos.ch/browse/LBCORE-212?page=com.atlassian.jira.plugin.system.i... ] Alexandre Garnier commented on LBCORE-212: ------------------------------------------ Maybe, the prefix parametrization is for people who could have properties starting with "env." ?... The solution can also be simply add all env vars as prefixed properties in ch.qos.logback.core.joran.action.PropertyAction : * no impact on substVars system with a test on the key to match the prefix * the possibility to parametrize the prefix if we want
Give access to environment variables in configuration file ----------------------------------------------------------
Key: LBCORE-212 URL: http://jira.qos.ch/browse/LBCORE-212 Project: logback-core Issue Type: New Feature Reporter: Alexandre Garnier Assignee: Ceki Gulcu
It would be very nice to be able to access environment variables in configuration files. Maybe like in ant with <property environment="env"/> and then ${env.PATH} to access variable. In my use case, it's necessary to get the path to the property file to load...
-- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira

[ http://jira.qos.ch/browse/LBCORE-212?page=com.atlassian.jira.plugin.system.i... ] Ceki Gulcu commented on LBCORE-212: ----------------------------------- Hi Alexandre, Looking at your patch at [1], I think it would be simpler to allow access to environment variables by prefixing their name "env." from anywhere. This obviates the need to define them within a property element and hence, I have to say, your patch as well. I'll look into this in the very near future. https://github.com/zigarn/logback/commit/9aa145824d2b55d371997d516c495
Give access to environment variables in configuration file ----------------------------------------------------------
Key: LBCORE-212 URL: http://jira.qos.ch/browse/LBCORE-212 Project: logback-core Issue Type: New Feature Reporter: Alexandre Garnier Assignee: Ceki Gulcu
It would be very nice to be able to access environment variables in configuration files. Maybe like in ant with <property environment="env"/> and then ${env.PATH} to access variable. In my use case, it's necessary to get the path to the property file to load...
-- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira

[ http://jira.qos.ch/browse/LBCORE-212?page=com.atlassian.jira.plugin.system.i... ] Ceki Gulcu commented on LBCORE-212: ----------------------------------- Hi Alexander, Environment variables are now part of the property look up process. See also [1]. Here is en excerpt from the modified docs: Properties are looked up in the the local scope first, in the context scope second, in the system properties scope third, and in the OS environment last. Let me know if this works for you. [1] http://github.com/ceki/logback/commit/0ee187332ad85e
Give access to environment variables in configuration file ----------------------------------------------------------
Key: LBCORE-212 URL: http://jira.qos.ch/browse/LBCORE-212 Project: logback-core Issue Type: New Feature Reporter: Alexandre Garnier Assignee: Ceki Gulcu
It would be very nice to be able to access environment variables in configuration files. Maybe like in ant with <property environment="env"/> and then ${env.PATH} to access variable. In my use case, it's necessary to get the path to the property file to load...
-- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
participants (2)
-
Alexandre Garnier (JIRA)
-
Ceki Gulcu (JIRA)