1
2
3
4
5
6
7
8
9
10
11 package psiprobe.tools.logging;
12
13 import java.io.File;
14 import java.sql.Timestamp;
15
16
17
18
19 public abstract class AbstractLogDestination extends DefaultAccessor implements LogDestination {
20
21 @Override
22 public boolean isRoot() {
23 return false;
24 }
25
26 @Override
27 public boolean isContext() {
28 return false;
29 }
30
31 @Override
32 public String getIndex() {
33 return null;
34 }
35
36 @Override
37 public String getConversionPattern() {
38 return null;
39 }
40
41
42
43
44
45
46 protected File getStdoutFile() {
47 File file = new File(System.getProperty("catalina.base"), "logs/catalina.out");
48 return file.exists() ? file : new File("stdout");
49 }
50
51 @Override
52 public File getFile() {
53 return getStdoutFile();
54 }
55
56 @Override
57 public long getSize() {
58 File file = getFile();
59 return file != null && file.exists() ? file.length() : 0;
60 }
61
62 @Override
63 public Timestamp getLastModified() {
64 File file = getFile();
65 return file != null && file.exists() ? new Timestamp(file.lastModified()) : null;
66 }
67
68 @Override
69 public String getLevel() {
70 return null;
71 }
72
73 @Override
74 public String[] getValidLevels() {
75 return new String[0];
76 }
77
78 @Override
79 public String getEncoding() {
80 return null;
81 }
82 }