On Wed, Jul 27, 2011 at 8:43 AM, Daniel Serodio (lists) < [email protected]> wrote:
> Ansgar Konermann wrote: > >> Am 25.07.2011 22:13, schrieb Daniel Serodio (lists): >> >>> Do you think using a classifier to differentiate artifacts built for >>> development and production is "hacky", is is this an appropriate >>> solution? >>> >> >> Use the same *artifacts* for all stages and allow for *configuring* the >> relevant properties of your application at runtime/startup time, as much >> as possible. >> >> A common mechanism to configure things at runtime is using JNDI >> parameters. >> > I'mconsidering changing our build process. Setting up the DB using JNDI is > easy enough, but how do you suggest we deal with different logging > configurations, which differ not only on some values, but structure (ie > log4j Loggers and Appenders with different classes, file paths and severity > thresholds) ? > > Either 1. Externalize the config file for each environment. 2. Package all config files for all environments and use an external indicator (unique per environment) to have the code select the correct one (e.g. an environment variable). Have defaults that work for all environments if not found (a good idea is to have the production configuration the default when not finding the external file or indicator).
