tomcat - How to make Glassfish use different configuration for every application -


i using glassfish, jboss, tomcat application servers.

i want use different log4j.properties applications on local, dev, test , prod envirment. every project's application should have different log4j.properties file.

for example: local don't want log4j send mail on test env send email x@domain.com on prod send email y@domain.com.

on other example:

project x send mail       : -dapp_conf_dir/projectx/log4j.properties project y don't send mail : -dapp_conf_dir/projecty/log4j.properties 

how can it?

by way using jenkins(hudson) re/deployment.

thanks.

sample log4j.properties file project x:

log4j.rootlogger = debug, console, file_out_debug, mail  # email appender log configuration log4j.appender.mail=org.apache.log4j.net.smtpappender #defines how othen emails send log4j.appender.mail.buffersize=100000 log4j.appender.mail.smtphost=10.11.12.13 log4j.appender.mail.smtphost=smtp.domain.com log4j.appender.email.smtpusername=user@domain.com log4j.appender.email.smtppassword=*** log4j.appender.mail.from=project x error web <projectx@domain.com> log4j.appender.mail.to=email@domain.com  log4j.appender.mail.subject=project x error web log4j.appender.mail.threshold=error log4j.appender.mai.filter=org.apache.log4j.varia.levelrangefilter log4j.appender.mai.filter.levelmin=error log4j.appender.mai.filter.levelmax=fatal log4j.appender.mail.layout=org.apache.log4j.patternlayout log4j.appender.mail.layout.conversionpattern=project x - %d{dd.mm.yyyy hh\:mm\:ss} %5p [%l] - %m %n\n 

if use maven can create profiles (with configuration properties) each type of build, , enable needed profile before build. can use profile settings in configuration files.


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -