<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<br>
<div class="moz-cite-prefix">On 6/23/14, 7:53 PM, Tom Zeller wrote:<br>
</div>
<blockquote
cite="mid:CAMNmQDT_No_9kyXFKT-Wd3dk4CdeS16HVW_csrak_OnioHSiWw@mail.gmail.com"
type="cite">
<blockquote type="cite">
<pre wrap="">
</pre>
</blockquote>
<pre wrap="">
Thanks, Brent.
Do you know if it is possible, given an ApplicationContext set via
ApplicationContextAware, to iterate over all properties by name ?</pre>
</blockquote>
<br>
No, not that I know of, and I don't see anything obvious glancing at
the relevant interfaces (Environment, PropertySources, etc). But as
with all things Spring, it's entirely possible there's some way to
do it....<br>
<br>
I just glanced at what you did with the LogbackLoggingService. If
there is no way to iterate the context properties like you asked
about: IMHO, rather than hardcoding 'idp.home' into the Java code,
it might be cleaner to externalize the specific set of properties
that you want to provide to Logback by wiring up a Properties
instance in the Spring config (with values coming from property
replacement) and injecting that straight into the LLS.<br>
<br>
Something like the below, and then inject that into the LLS
directly. That way you get to pick exactly what you want to expose
to Logback, which I imagine is only a handful of props (maybe even
1?).<br>
<br>
<tt> <util:properties></tt><tt><br>
</tt><tt> <prop key="idp.home">${idp.home}</prop></tt><tt><br>
</tt><tt> </util:properties></tt><tt><br>
</tt><br>
Then the code in the LLS is very simple and generic. Just my $.02.<br>
</body>
</html>