Quantcast

Howto define logging level depending on APPLICATION_ENV

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Howto define logging level depending on APPLICATION_ENV

Jochen Riks
Hi,

I want to control the logging levels with the value of APPLICATION_ENV:

in our setup we have development, staging and production servers -- the
production one is running with APPLICATION_ENV='production' and all others
with APPLICATION_ENV='development'.

The value of APPLICATION_ENV is configured with an ENV value in the apache
config because we don't want to have different vufind config files on the
servers (controlled with git).

I found the logging is configured in (local/)config/vufind/config.ini where
I can set the log level for each logging method.

What I want to have is the option to define that there will be different
loglevels used for i.e. the method 'file' for production and development
servers without using different config.ini files...

So, my question here is how to do that the best way?

Thanks and regards,
Jochen


--
Jochen Riks
Stellv. Leiter des Dezernates Bibliotheks-IT
Fachreferat Physik

Universitaets- und Landesbibliothek Duesseldorf
Universitaetsstrasse 1, Geb. 24.41
D-40225 Duesseldorf

Tel  : 0211/81-15749
Fax  : 0211/81-13054
Email: [hidden email]

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Vufind-tech mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vufind-tech
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Howto define logging level depending on APPLICATION_ENV

Demian Katz
My suggestion would be to customize the factory that builds the logging service so that it appends APPLICATION_ENV onto the name of the config section it reads Logging settings from. Then you could have Logging_development and Logging_production settings in your config.ini, and the code would read the appropriate version in the appropriate context.

Which version of VuFind are you using? If you give me the details, I can identify the relevant part of the code you would need to customize.

- Demian

-----Original Message-----
From: Jochen Riks [mailto:[hidden email]]
Sent: Thursday, March 16, 2017 8:36 AM
To: [hidden email]
Subject: [VuFind-Tech] Howto define logging level depending on APPLICATION_ENV

Hi,

I want to control the logging levels with the value of APPLICATION_ENV:

in our setup we have development, staging and production servers -- the production one is running with APPLICATION_ENV='production' and all others with APPLICATION_ENV='development'.

The value of APPLICATION_ENV is configured with an ENV value in the apache config because we don't want to have different vufind config files on the servers (controlled with git).

I found the logging is configured in (local/)config/vufind/config.ini where I can set the log level for each logging method.

What I want to have is the option to define that there will be different loglevels used for i.e. the method 'file' for production and development servers without using different config.ini files...

So, my question here is how to do that the best way?

Thanks and regards,
Jochen


--
Jochen Riks
Stellv. Leiter des Dezernates Bibliotheks-IT Fachreferat Physik

Universitaets- und Landesbibliothek Duesseldorf Universitaetsstrasse 1, Geb. 24.41
D-40225 Duesseldorf

Tel  : 0211/81-15749
Fax  : 0211/81-13054
Email: [hidden email]

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fsdm.link%2Fslashdot&data=02%7C01%7Cdemian.katz%40villanova.edu%7C4b854406c0fd40388e3f08d46c6b80a5%7C765a8de5cf9444f09cafae5bf8cfa366%7C1%7C0%7C636252656347027406&sdata=jK1Lm0owj%2B%2Bo%2FQGZd83l5fWXAHh5npkwdnDVCpdGSmg%3D&reserved=0
_______________________________________________
Vufind-tech mailing list
[hidden email]
https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.sourceforge.net%2Flists%2Flistinfo%2Fvufind-tech&data=02%7C01%7Cdemian.katz%40villanova.edu%7C4b854406c0fd40388e3f08d46c6b80a5%7C765a8de5cf9444f09cafae5bf8cfa366%7C1%7C0%7C636252656347027406&sdata=Fj6kYfs1pcvCPL%2FKZhIMmzi7%2FZJD4L2iHC4V4pqoGPI%3D&reserved=0

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Vufind-tech mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vufind-tech
Loading...