Revision 30540
Added by Sandro La Bruzzo about 10 years ago
modules/cnr-log4j-inspector/tags/cnr-log4j-inspector-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-inspector</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-inspector/tags/cnr-log4j-inspector-1.0.0</developerConnection> |
|
15 |
</scm> |
|
16 |
|
|
17 |
<dependencies> |
|
18 |
<dependency> |
|
19 |
<groupId>junit</groupId> |
|
20 |
<artifactId>junit</artifactId> |
|
21 |
<version>${junit.version}</version> |
|
22 |
<scope>test</scope> |
|
23 |
</dependency> |
|
24 |
<dependency> |
|
25 |
<groupId>eu.dnetlib</groupId> |
|
26 |
<artifactId>cnr-inspector</artifactId> |
|
27 |
<version>[1.0.0,2.0.0)</version> |
|
28 |
</dependency> |
|
29 |
<dependency> |
|
30 |
<groupId>eu.dnetlib</groupId> |
|
31 |
<artifactId>cnr-log4j-management</artifactId> |
|
32 |
<version>[1.0.0,2.0.0)</version> |
|
33 |
</dependency> |
|
34 |
</dependencies> |
|
35 |
</project> |
modules/cnr-log4j-inspector/tags/cnr-log4j-inspector-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-inspector/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-inspector"} |
modules/cnr-log4j-inspector/tags/cnr-log4j-inspector-1.0.0/src/main/java/eu/dnetlib/enabling/inspector/Log4jInspector.java | ||
---|---|---|
1 |
package eu.dnetlib.enabling.inspector; |
|
2 |
|
|
3 |
import org.apache.log4j.Level; |
|
4 |
import org.apache.log4j.LogManager; |
|
5 |
import org.springframework.stereotype.Controller; |
|
6 |
import org.springframework.ui.Model; |
|
7 |
import org.springframework.web.bind.annotation.RequestMapping; |
|
8 |
import org.springframework.web.bind.annotation.RequestMethod; |
|
9 |
import org.springframework.web.bind.annotation.RequestParam; |
|
10 |
|
|
11 |
@Controller |
|
12 |
public class Log4jInspector extends AbstractInspectorController { |
|
13 |
|
|
14 |
@RequestMapping(value = "/inspector/log4j.do", method = RequestMethod.GET) |
|
15 |
public void log4j(final Model model) { |
|
16 |
|
|
17 |
} |
|
18 |
|
|
19 |
@RequestMapping(value = "/inspector/log4j.do", method = RequestMethod.POST) |
|
20 |
public String log4j( |
|
21 |
final Model model, |
|
22 |
@RequestParam(value = "classname", required = false) String classname, |
|
23 |
@RequestParam(value = "level", required = false) String level) { |
|
24 |
|
|
25 |
if (classname != null && level != null) { |
|
26 |
LogManager.getLogger(classname).setLevel(Level.toLevel(level)); |
|
27 |
//model.addAttribute("message", "Log level for: " + classname + " set to: " + level); |
|
28 |
} |
|
29 |
return "redirect:log4j.do"; |
|
30 |
} |
|
31 |
|
|
32 |
} |
modules/cnr-log4j-inspector/tags/cnr-log4j-inspector-1.0.0/src/main/resources/eu/dnetlib/enabling/inspector/webContext-log4j-inspector.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:p="http://www.springframework.org/schema/p" |
|
4 |
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> |
|
5 |
|
|
6 |
<bean id="log4jInspectorGroup" |
|
7 |
class="eu.dnetlib.enabling.inspector.StaticEntryPointDescriptorGroup" |
|
8 |
p:name="log4j"> |
|
9 |
<property name="descriptors"> |
|
10 |
<list> |
|
11 |
<bean class="eu.dnetlib.enabling.inspector.StaticEntryPointDescriptor" |
|
12 |
p:name="log4j" p:relativeUrl="log4j.do" /> |
|
13 |
</list> |
|
14 |
</property> |
|
15 |
</bean> |
|
16 |
|
|
17 |
</beans> |
modules/cnr-log4j-inspector/tags/cnr-log4j-inspector-1.0.0/src/main/resources/eu/dnetlib/enabling/views/inspector/log4j.st | ||
---|---|---|
1 |
$inspector/master(it={ |
|
2 |
<h2>Log4j Inspector</h2> |
|
3 |
|
|
4 |
<form method="POST"> |
|
5 |
Classname <input name="classname" type="text" /> |
|
6 |
Level |
|
7 |
<select name="level"> |
|
8 |
<option value="OFF">OFF</option> |
|
9 |
<option value="FATAL">FATAL</option> |
|
10 |
<option value="ERROR">ERROR</option> |
|
11 |
<option value="WARN">WARN</option> |
|
12 |
<option value="INFO">INFO</option> |
|
13 |
<option value="DEBUG">DEBUG</option> |
|
14 |
</select> |
|
15 |
|
|
16 |
<input type="submit" /> |
|
17 |
|
|
18 |
<p>$message$</p> |
|
19 |
|
|
20 |
|
|
21 |
</form> |
|
22 |
|
|
23 |
|
|
24 |
})$ |
Also available in: Unified diff
[maven-release-plugin] copy for tag cnr-log4j-inspector-1.0.0