1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package org.apache.pluto.portalImpl.services.log;
21
22 import org.apache.pluto.services.log.Logger;
23
24 /*** Defines a LogService that may be used when
25 * one has not been registered with the ServiceManager.
26 * This is specifically usefull in cases, such as
27 * when the Deployer is run, in which no Service are
28 * registered.
29 *
30 * The StandardOutLogService is implemented as a
31 * Singleton since all log messages will be going
32 * to StandardOut no matter what! Since all behaivior
33 * will be identical, there's no reason to create
34 * multiple instances.
35 */
36 public class StandardOutLogService extends LogService {
37
38 private static Logger logger = null;
39
40 private static LogService service;
41
42 public static LogService getInstance() {
43 if(service==null)
44 service = new StandardOutLogService();
45 return service;
46 }
47
48 private StandardOutLogService() {
49 logger = new StandardOutLogger();
50 }
51
52 public Logger getLogger(String aComponent) {
53 return logger;
54 }
55
56 public Logger getLogger(Class klass) {
57 return logger;
58 }
59
60 }