Re: Re: java logging properties and lein

2011-11-14 Thread labwork07
I put a logging.properties file in the resources directory of the project  
but it does not seem to pick it up. Do I have to do something else to  
override the default logging from the java library I am using?


On , Phil Hagelberg  wrote:

On Mon, Nov 14, 2011 at 9:22 AM, joegallo joega...@gmail.com> wrote:



> You could drop it into the root of src, or you can add a :resources-path


> "etc" in your project.clj and then put it in the root of that. Some  
purists


> would probably argue that the latter is better, but the former should  
work



> just fine, too.





Actually if the resources/ dir exists in the project root you don't



have to add anything to project.clj; it will use it by default.





-Phil





--



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 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

Re: Re: java logging properties and lein

2011-11-14 Thread Mark Rathwell
> I put a logging.properties file in the resources directory of the project
> but it does not seem to pick it up. Do I have to do something else to
> override the default logging from the java library I am using?

You still need to load the properties and tell the logger to use them.
 Assuming it is using log4j, something like the following should do
that (completely untested though):

...
  (:require [clojure.java.io :as io])
...
(with-open [s (io/input-stream (io/resource "logging.properties"))]
  (org.apache.log4j.PropertyConfigurator/configure
(doto (java.util.Properties.)
  (.load s


On Mon, Nov 14, 2011 at 4:19 PM,   wrote:
> I put a logging.properties file in the resources directory of the project
> but it does not seem to pick it up. Do I have to do something else to
> override the default logging from the java library I am using?
>
> On , Phil Hagelberg  wrote:
>> On Mon, Nov 14, 2011 at 9:22 AM, joegallo joega...@gmail.com> wrote:
>>
>> > You could drop it into the root of src, or you can add a :resources-path
>>
>> > "etc" in your project.clj and then put it in the root of that.  Some
>> > purists
>>
>> > would probably argue that the latter is better, but the former should
>> > work
>>
>> > just fine, too.
>>
>>
>>
>> Actually if the resources/ dir exists in the project root you don't
>>
>> have to add anything to project.clj; it will use it by default.
>>
>>
>>
>> -Phil
>>
>>
>>
>> --
>>
>> 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 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 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


Re: Re: java logging properties and lein

2011-11-14 Thread Mark Rathwell
> You still need to load the properties and tell the logger to use them.
>  Assuming it is using log4j, something like the following should do
> that (completely untested though):
>
> ...
>  (:require [clojure.java.io :as io])
> ...
> (with-open [s (io/input-stream (io/resource "logging.properties"))]
>  (org.apache.log4j.PropertyConfigurator/configure
>    (doto (java.util.Properties.)
>      (.load s

I should have noted:  Unless the library you're using is already
checking for and loading a resource called "logging.properties", in
which case it should work just by dropping in the properties file in
the resources directory.

-- 
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


Re: Re: Re: java logging properties and lein

2011-11-15 Thread labwork07
Okay, thanks. I think the library I interface with is using  
java.util.logging.
I might need to reset the logging configuration. I recall something like  
that in the past like

LogManager.reset();

On , Mark Rathwell  wrote:

> You still need to load the properties and tell the logger to use them.



> Assuming it is using log4j, something like the following should do



> that (completely untested though):



>



> ...



> (:require [clojure.java.io :as io])



> ...



> (with-open [s (io/input-stream (io/resource "logging.properties"))]



> (org.apache.log4j.PropertyConfigurator/configure



> (doto (java.util.Properties.)



> (.load s





I should have noted: Unless the library you're using is already



checking for and loading a resource called "logging.properties", in



which case it should work just by dropping in the properties file in



the resources directory.





--



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 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

Re: Re: Re: java logging properties and lein

2011-11-15 Thread labwork07
Okay, thanks. I think the library I interface with is using  
java.util.logging.
I might need to reset the logging configuration. I recall something like  
that in the past like

LogManager.reset();

On , Mark Rathwell  wrote:

> You still need to load the properties and tell the logger to use them.



> Assuming it is using log4j, something like the following should do



> that (completely untested though):



>



> ...



> (:require [clojure.java.io :as io])



> ...



> (with-open [s (io/input-stream (io/resource "logging.properties"))]



> (org.apache.log4j.PropertyConfigurator/configure



> (doto (java.util.Properties.)



> (.load s





I should have noted: Unless the library you're using is already



checking for and loading a resource called "logging.properties", in



which case it should work just by dropping in the properties file in



the resources directory.





--



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 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