The trick is, don't build the original jar with the logback config file. No
dependent of that jar wants to be told how to do logging. You should keep
your logback.xml in the /config directory, not in /resources.

As far as -D, that's to pass environment parameters to the JVM. See
http://logback.qos.ch/manual/configuration.html#configFileProperty for how
to configure the logback.xml location that way.

To recap: don't include logback.xml in any jars, anywhere (except for test
versions, which logback supports). Have it living in production on the file
system, and point to that file on startup. That way, you can have
environment-specific logging configured in that environment.

jason



On Thu, Aug 15, 2013 at 5:06 PM, Stephen Cagle <same...@gmail.com> wrote:

> I don't know what -D is, other than a one eyed laughing face. :D
>
> Is there some sort of standard for this? Do people simply write a script
> that checks out the code and remove files that they don't want in the
> generated jar? Is there something I can put in my project.clj that
> specifies what I *don't* want included in a generated jar? How do people
> generally go about it.
>
> Not that it is a big deal, mind you. It just seems a bit busy to have to
> write a special script that 1) checks out my code from github 2)removes the
> files I don't want in the jar 3) builds the jar 4) does whatever else I am
> forgetting. Seems like there might be something simpler that I don't know
> about.
>
>
> On Thursday, August 15, 2013 4:38:01 PM UTC-7, Jason Bennett wrote:
>>
>> You shouldn't include the logback.xml in the generated jar file.
>>
>> Only the ultimately generated artifact should have a logback.xml file,
>> best loaded from the file system (possibly through -D). It doesn't matter
>> what settings base has for logging, derive should set all logging
>> parameters.
>>
>> jason
>>
>> On Thursday, August 15, 2013 3:51:04 PM UTC-7, Stephen Cagle wrote:
>>>
>>> I have project 'base' that has a logback.xml file and project 'derive'
>>> that also has a logback.xml file. Project 'derive' has a dependency on
>>> 'base'. When I "lein trampoline repl" on project 'derive', I get the
>>> following warning.
>>>
>>> ....
>>> 15:34:30,066 |-INFO in ch.qos.logback.classic.**LoggerContext[default]
>>> - Could NOT find resource [logback.groovy]
>>> 15:34:30,066 |-INFO in ch.qos.logback.classic.**LoggerContext[default]
>>> - Could NOT find resource [logback-test.xml]
>>> 15:34:30,066 |-INFO in ch.qos.logback.classic.**LoggerContext[default]
>>> - Found resource [logback.xml] at [file:/home/stephen/Work/com.**
>>> samedhi/derive/client/config/**logback.xml]
>>> 15:34:30,067 |-WARN in ch.qos.logback.classic.**LoggerContext[default]
>>> - Resource [logback.xml] occurs multiple times on the classpath.
>>> 15:34:30,067 |-WARN in ch.qos.logback.classic.**LoggerContext[default]
>>> - Resource [logback.xml] occurs at [jar:file:/home/stephen/.m2/**
>>> repository/com/samedhi/base.**app/0.0.1-SNAPSHOT/base.app-0.**
>>> 0.1-SNAPSHOT.jar!/logback.xml]
>>> 15:34:30,067 |-WARN in ch.qos.logback.classic.**LoggerContext[default]
>>> - Resource [logback.xml] occurs at [file:/home/stephen/Work/com.**
>>> samedhi/derive/client/config/**logback.xml]
>>> 15:34:30,129 |-INFO in 
>>> ch.qos.logback.classic.joran.**action.ConfigurationAction
>>> - debug attribute not set
>>> ....
>>>
>>> So, the problem appears to be that I have two logback.xml's in my
>>> classpath. What am I supposed to do to "surpress" the logback.xml from
>>> project 'base'?
>>>
>>  --
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "Clojure" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/clojure/jeVTo0aWWb4/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
Jason Bennett, jaso...@acm.org
E pur si muove!
Get Firefox! - http://getfirefox.com

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to