title: How to setup a central logging server and divide logging events from test and production?
body: <p>How best should I setup a central logging (or perhaps 2, each one exclusive to either test or prod) server such that:</p>
  
  <p>I do not have to worry about the code referencing any conditionals that might accidentally log non-prod errors into the production error log4j bus. In other words, I do not wants to have code such as:</p>
  
  <pre><code>if (!production)
    logWrapper.logTest(error);
  else 
    logWrapper.logProd(error);
  </code></pre>
  
  <p>I do not want this because it tightly couples something such as the server name, references it, and now the code can only work on one of two server names: prod and test. Nor can I declaratively set this in a config because of the probability that a developer will not set this correctly and pollute the logging repositories. <strong>Any Suggestions?</strong></p>
  
  <p>A few details, some aren't going to factor in but I list them anyway:</p>
  
  <ul>
  <li>Only web applications, running on <strong>Oracle Application Server</strong> 10.1.3.4 now, and in the future Oracle WebLogic</li>
  <li>going to be using a central logging server as demonstrated in this example: <a href="http://timarcher.com/?q=node/10" rel="nofollow noreferrer">http://timarcher.com/?q=node/10</a> ...EXCEPT that the central server will log text files and not perform emailing!</li>
  <li>Will use log4j and maybe it will be wrapped via slf4j (the slf4j is kind of irreverent to mention so ignore it for the most part..)</li>
  </ul>