Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 35336 invoked from network); 15 Apr 2010 19:23:14 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 15 Apr 2010 19:23:14 -0000 Received: (qmail 60889 invoked by uid 500); 15 Apr 2010 19:23:14 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 60850 invoked by uid 500); 15 Apr 2010 19:23:14 -0000 Mailing-List: contact dev-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openjpa.apache.org Delivered-To: mailing list dev@openjpa.apache.org Received: (qmail 60842 invoked by uid 99); 15 Apr 2010 19:23:14 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Apr 2010 19:23:14 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Apr 2010 19:23:11 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o3FJMmSf025582 for ; Thu, 15 Apr 2010 15:22:49 -0400 (EDT) Message-ID: <3433281.149171271359368478.JavaMail.jira@thor> Date: Thu, 15 Apr 2010 15:22:48 -0400 (EDT) From: "Michael Dick (JIRA)" To: dev@openjpa.apache.org Subject: [jira] Reopened: (OPENJPA-1557) Logging configuration is difficult for running tests In-Reply-To: <1890382119.161701268165547131.JavaMail.jira@brutus.apache.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/OPENJPA-1557?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Michael Dick reopened OPENJPA-1557: ----------------------------------- reopening to indicate it's fixed in 1.0.4 and 1.2.3 > Logging configuration is difficult for running tests > ---------------------------------------------------- > > Key: OPENJPA-1557 > URL: https://issues.apache.org/jira/browse/OPENJPA-1557 > Project: OpenJPA > Issue Type: Improvement > Affects Versions: 1.2.2, 2.0.0-beta2 > Reporter: Craig L Russell > Assignee: Craig L Russell > Fix For: 1.0.4, 1.2.3, 1.3.0, 2.0.0-beta3 > > Attachments: OPENJPA-1557.diff.txt > > > Logging is difficult to configure and is incorrectly documented for running tests. > There is a system property that can be set on the command line when running tests using surefire: openjpa.loglevel. This property, set via -Dopenjpa.loglevel, is used in the pom.xml to send logging properties to the runtime. The simple case works, e.g. -Dopenjpa.loglevel=error. This affects enhancement and the test runtime to report only errors. > However, setting this property also results in warnings: > enhance.all.entities: > [echo] running enhancer > 12 WARN [main] openjpa.Runtime - The configuration property named "openjpa.loglevel" was not recognized and will be ignored, although the name closely matches a valid property called "openjpa.Log". > 2 WARN [main] openjpa.Runtime - The configuration property named "openjpa.loglevel" was not recognized and will be ignored, although the name closely matches a valid property called "openjpa.Log". > This is because the property is both passed to the runtime and also used to configure the log level via the surefire plugin (the relevant part of the pom.xml follows): > > openjpa.Log > DefaultLevel=${openjpa.loglevel} > > Via "property injection" it's also possible to set any number of other log properties using this mechanism, although it's a bit odd. Just concatenate the extra properties after the level. For example, > mvn test -Dopenjpa.loglevel=trace,file=openjpa.log,Runtime=info > This will set the default log level to trace, send the log output to the file openjpa.log, and set the Runtime log level to info. > The surefire plugin effectively disables the openjpa.Log so the user cannot use this property. > The warning can be removed by changing the PersistenceTestCase.createNamedEMF: > Map map = new HashMap(System.getProperties()); > map.remove("openjpa.level"); > But the enhancer doesn't go through this path. > Before I change the online documentation I'd like to see if anyone else has any ideas how to make this easier. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira