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