Mantis - Resin
Viewing Issue Advanced Details
6087 feature always 08-18-17 11:16 11-21-17 09:42
wileysaw  
ferg  
normal  
closed 4.0.53  
fixed  
none    
none 4.0.54  
0006087: Add support to Syslog Handler for formatted messages
Note from user:

It's worth just putting this functionality in a base class or something. For now I've added the below to my own handler extending your syslog handler and used that.


  /**
   * Sets the formatter.
   */
  @Override
  public void setFormatter(Formatter formatter)
  {
    _formatter = formatter;
  }

  /**
   * Publishes the record new power generation style.
   */
  public void publish(LogRecord record)
  {
    if (! isLoggable(record))
      return;

    String value = record.getMessage();

    if(_formatter != null)
      value = _formatter.format(record);

    Syslog.syslog(1, 6, value);
  }

There are no notes attached to this issue.