File tree 3 files changed +32
-0
lines changed
todolist-goof/todolist-web-struts
java/io/github/benas/todolist/web/action/todo 3 files changed +32
-0
lines changed Original file line number Diff line number Diff line change 24
24
<version >0.0.1-SNAPSHOT</version >
25
25
</dependency >
26
26
27
+ <dependency >
28
+ <groupId >org.apache.logging.log4j</groupId >
29
+ <artifactId >log4j-core</artifactId >
30
+ <version >2.7</version >
31
+ </dependency >
32
+ <dependency >
33
+ <groupId >org.apache.logging.log4j</groupId >
34
+ <artifactId >log4j-api</artifactId >
35
+ <version >2.7</version >
36
+ </dependency >
37
+
27
38
<!-- javaee web api -->
28
39
<dependency >
29
40
<groupId >javax</groupId >
Original file line number Diff line number Diff line change 30
30
31
31
import java .util .List ;
32
32
33
+ import org .apache .logging .log4j .LogManager ;
34
+ import org .apache .logging .log4j .Logger ;
35
+
33
36
/**
34
37
* Action class to search todo list by title.
35
38
*
36
39
* @author Mahmoud Ben Hassine ([email protected] )
37
40
*/
38
41
public class SearchTodoAction extends BaseAction {
42
+ private static final Logger logger = LogManager .getLogger (SearchTodoAction .class );
39
43
40
44
private String title ;
41
45
42
46
List <Todo > todoList ;
43
47
44
48
public String execute () {
49
+ logger .info ("Searching for: " + title );
45
50
todoList = todoService .searchTodoListByTitle (getSessionUser ().getId (), title );
46
51
return Action .SUCCESS ;
47
52
}
Original file line number Diff line number Diff line change
1
+ # Extra logging related to initialization of Log4j
2
+ # Set to debug or trace if log4j initialization is failing
3
+ status = warn
4
+ # Name of the configuration
5
+ name = ConsoleLogConfigDemo
6
+
7
+ # Console appender configuration
8
+ appender.console.type = Console
9
+ appender.console.name = consoleLogger
10
+ appender.console.layout.type = PatternLayout
11
+ appender.console.layout.pattern = %d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n
12
+
13
+ # Root logger level
14
+ rootLogger.level = info
15
+ # Root logger referring to console appender
16
+ rootLogger.appenderRef.stdout.ref = consoleLogger
You can’t perform that action at this time.
0 commit comments