Revision 45166
Added by Claudio Atzori about 7 years ago
modules/cnr-log4j-management/trunk/deploy.info | ||
---|---|---|
1 |
{"type_source": "SVN", "goal": "package -U -T 4C source:jar", "url": "http://svn-public.driver.research-infrastructures.eu/driver/dnet40/modules/cnr-log4j-management/trunk/", "deploy_repository": "dnet4-snapshots", "version": "4", "mail": "sandro.labruzzo@isti.cnr.it,michele.artini@isti.cnr.it, claudio.atzori@isti.cnr.it, alessia.bardi@isti.cnr.it", "deploy_repository_url": "http://maven.research-infrastructures.eu/nexus/content/repositories/dnet4-snapshots", "name": "cnr-log4j-management"} |
modules/cnr-log4j-management/trunk/src/main/java/eu/dnetlib/management/log4j/Log4JMBean.java | ||
---|---|---|
1 |
package eu.dnetlib.management.log4j; |
|
2 |
|
|
3 |
import org.apache.log4j.Level; |
|
4 |
import org.apache.log4j.LogManager; |
|
5 |
|
|
6 |
/** |
|
7 |
* Exports log level control via jmx. |
|
8 |
* |
|
9 |
* @author marko |
|
10 |
* |
|
11 |
*/ |
|
12 |
public class Log4JMBean { |
|
13 |
public void setLogger(String category, String level) { |
|
14 |
LogManager.getLogger(category).setLevel(Level.toLevel(level)); |
|
15 |
} |
|
16 |
} |
modules/cnr-log4j-management/trunk/src/main/resources/eu/dnetlib/management/log4j/applicationContext-log4j-jmx.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
<beans xmlns="http://www.springframework.org/schema/beans" |
|
3 |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" |
|
4 |
xmlns:jee="http://www.springframework.org/schema/jee" xmlns:lang="http://www.springframework.org/schema/lang" |
|
5 |
xmlns:p="http://www.springframework.org/schema/p" xmlns:tx="http://www.springframework.org/schema/tx" |
|
6 |
xmlns:util="http://www.springframework.org/schema/util" |
|
7 |
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd |
|
8 |
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd |
|
9 |
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee.xsd |
|
10 |
http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang.xsd |
|
11 |
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd |
|
12 |
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd"> |
|
13 |
|
|
14 |
|
|
15 |
<bean id="jmxExporter" class="org.springframework.jmx.export.MBeanExporter"> |
|
16 |
<property name="beans"> |
|
17 |
<map> |
|
18 |
<entry key="log4j:name=settings" value-ref="log4jMBean" /> |
|
19 |
</map> |
|
20 |
</property> |
|
21 |
</bean> |
|
22 |
|
|
23 |
<bean id="log4jMBean" class="eu.dnetlib.management.log4j.Log4JMBean" /> |
|
24 |
|
|
25 |
</beans> |
modules/cnr-log4j-management/trunk/pom.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> |
|
3 |
<parent> |
|
4 |
<groupId>eu.dnetlib</groupId> |
|
5 |
<artifactId>dnet-parent</artifactId> |
|
6 |
<version>1.0.0</version> |
|
7 |
</parent> |
|
8 |
<modelVersion>4.0.0</modelVersion> |
|
9 |
<groupId>eu.dnetlib</groupId> |
|
10 |
<artifactId>cnr-log4j-management</artifactId> |
|
11 |
<packaging>jar</packaging> |
|
12 |
<version>1.0.1-SNAPSHOT</version> |
|
13 |
<scm> |
|
14 |
<developerConnection>scm:svn:https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/cnr-log4j-management/trunk</developerConnection> |
|
15 |
</scm> |
|
16 |
<dependencies> |
|
17 |
<dependency> |
|
18 |
<groupId>log4j</groupId> |
|
19 |
<artifactId>log4j</artifactId> |
|
20 |
<version>${log4j.version}</version> |
|
21 |
</dependency> |
|
22 |
<dependency> |
|
23 |
<groupId>org.springframework</groupId> |
|
24 |
<artifactId>spring-context</artifactId> |
|
25 |
<version>${spring.version}</version> |
|
26 |
</dependency> |
|
27 |
</dependencies> |
|
28 |
</project> |
modules/cnr-log4j-management/tags/cnr-log4j-management-1.0.0/deploy.info | ||
---|---|---|
1 |
{"type_source": "SVN", "goal": "package -U -T 4C source:jar", "url": "http://svn-public.driver.research-infrastructures.eu/driver/dnet40/modules/cnr-log4j-management/trunk/", "deploy_repository": "dnet4-snapshots", "version": "4", "mail": "sandro.labruzzo@isti.cnr.it,michele.artini@isti.cnr.it, claudio.atzori@isti.cnr.it, alessia.bardi@isti.cnr.it", "deploy_repository_url": "http://maven.research-infrastructures.eu/nexus/content/repositories/dnet4-snapshots", "name": "cnr-log4j-management"} |
modules/cnr-log4j-management/tags/cnr-log4j-management-1.0.0/src/main/java/eu/dnetlib/management/log4j/Log4JMBean.java | ||
---|---|---|
1 |
package eu.dnetlib.management.log4j; |
|
2 |
|
|
3 |
import org.apache.log4j.Level; |
|
4 |
import org.apache.log4j.LogManager; |
|
5 |
|
|
6 |
/** |
|
7 |
* Exports log level control via jmx. |
|
8 |
* |
|
9 |
* @author marko |
|
10 |
* |
|
11 |
*/ |
|
12 |
public class Log4JMBean { |
|
13 |
public void setLogger(String category, String level) { |
|
14 |
LogManager.getLogger(category).setLevel(Level.toLevel(level)); |
|
15 |
} |
|
16 |
} |
modules/cnr-log4j-management/tags/cnr-log4j-management-1.0.0/src/main/resources/eu/dnetlib/management/log4j/applicationContext-log4j-jmx.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
<beans xmlns="http://www.springframework.org/schema/beans" |
|
3 |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" |
|
4 |
xmlns:jee="http://www.springframework.org/schema/jee" xmlns:lang="http://www.springframework.org/schema/lang" |
|
5 |
xmlns:p="http://www.springframework.org/schema/p" xmlns:tx="http://www.springframework.org/schema/tx" |
|
6 |
xmlns:util="http://www.springframework.org/schema/util" |
|
7 |
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd |
|
8 |
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd |
|
9 |
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee.xsd |
|
10 |
http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang.xsd |
|
11 |
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd |
|
12 |
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd"> |
|
13 |
|
|
14 |
|
|
15 |
<bean id="jmxExporter" class="org.springframework.jmx.export.MBeanExporter"> |
|
16 |
<property name="beans"> |
|
17 |
<map> |
|
18 |
<entry key="log4j:name=settings" value-ref="log4jMBean" /> |
|
19 |
</map> |
|
20 |
</property> |
|
21 |
</bean> |
|
22 |
|
|
23 |
<bean id="log4jMBean" class="eu.dnetlib.management.log4j.Log4JMBean" /> |
|
24 |
|
|
25 |
</beans> |
modules/cnr-log4j-management/tags/cnr-log4j-management-1.0.0/pom.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> |
|
3 |
<parent> |
|
4 |
<groupId>eu.dnetlib</groupId> |
|
5 |
<artifactId>dnet-parent</artifactId> |
|
6 |
<version>1.0.0</version> |
|
7 |
</parent> |
|
8 |
<modelVersion>4.0.0</modelVersion> |
|
9 |
<groupId>eu.dnetlib</groupId> |
|
10 |
<artifactId>cnr-log4j-management</artifactId> |
|
11 |
<packaging>jar</packaging> |
|
12 |
<version>1.0.0</version> |
|
13 |
<scm> |
|
14 |
<developerConnection>scm:svn:https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/cnr-log4j-management/tags/cnr-log4j-management-1.0.0</developerConnection> |
|
15 |
</scm> |
|
16 |
<dependencies> |
|
17 |
<dependency> |
|
18 |
<groupId>log4j</groupId> |
|
19 |
<artifactId>log4j</artifactId> |
|
20 |
<version>${log4j.version}</version> |
|
21 |
</dependency> |
|
22 |
<dependency> |
|
23 |
<groupId>org.springframework</groupId> |
|
24 |
<artifactId>spring-context</artifactId> |
|
25 |
<version>${spring.version}</version> |
|
26 |
</dependency> |
|
27 |
</dependencies> |
|
28 |
</project> |
Also available in: Unified diff
codebase used to migrate to java8 the production system