0

I have a web application with a couple of profiles - for production and for local testing; build is executed with maven; logback is used for logging

so some of logs write to files - the problem is: in production we use tomcat and CATALINA_HOME is set on server, but locally we often use jetty, so tomcat may even not be configured

so in prod i want to write log in file this way: ${catalina.home}/logs/profiler.%d{yyyy-MM-dd}.log

how do I set maven override this ${catalina.home} property

  1. how do i set it from maven (do i need system properties or just maven properties)
  2. may i make it conditional? (if it is not set on the local system then use the property defined in #1)

thanks a lot! tatiana.

tania
  • 1,086
  • 2
  • 12
  • 31

1 Answers1

0

You can define a maven property, say log.dir and set it to appropriate values in each profile.

Say,

    <profile>
        <id>dev</id>
        <properties>
            <log.dir>${catalina.home}/...</log.dirv>
        </properties>
    </profile>
Raghuram
  • 51,854
  • 11
  • 110
  • 122