1 29 30 package com.caucho.log; 31 32 import com.caucho.config.ConfigException; 33 import com.caucho.vfs.WriteStream; 34 35 import javax.annotation.PostConstruct; 36 import java.io.IOException ; 37 38 41 public class StdoutLog extends RotateLog { 42 private String _timestamp; 43 44 47 public StdoutLog() 48 { 49 } 51 52 55 public String getTagName() 56 { 57 return "stdout-log"; 58 } 59 60 63 public void setTimestamp(String timestamp) 64 { 65 _timestamp = timestamp; 66 } 67 68 71 @PostConstruct 72 public void init() 73 throws ConfigException, IOException 74 { 75 super.init(); 76 77 WriteStream out = getRotateStream().getStream(); 78 79 if (_timestamp != null) { 80 out = new WriteStream(new TimestampFilter(out, _timestamp)); 81 } 82 83 EnvironmentStream.setStdout(out); 84 } 85 } 86 87 88 | Popular Tags |