[logback-user] Joran errors I don't understand

ralph.goers @dslextreme.com rgoers at apache.org
Thu Nov 17 22:30:31 CET 2011


Your configuration below indicates you have extended the JMSQueueAppender
or have written your own - i.e. class=com.whatever.**JMSQueueAppender.
 That class needs:

Layout layout;

public void setLayout(Layout layout) {
  this.layout = layout;
}

public Layout getLayout() {
  return this.layout;
}

In your append method you then need to call layout.doLayout(event) to get
the String result that you want to send.

Ralph

On Thu, Nov 17, 2011 at 12:53 PM, Steve Cohen <scohen at javactivity.org>wrote:

> Eh, how does that work?
> How do you tell it what layout to use?
>
>
>
> On 11/17/2011 02:12 PM, ralph.goers @dslextreme.com wrote:
>
>> The JMS and Socket appenders in Logback do not allow you to specify an
>> encoder. If you want to do that you need to add a getter and setter for
>> that to your version of the JMSQueueAppender. However, if you really want
>> a
>> String instead of a byte array you can just as easily use a Layout instead
>> of an encoder.
>>
>> Ralph
>>
>>
>> On Thu, Nov 17, 2011 at 11:33 AM, Steve Cohen<scohen at javactivity.org>**
>> wrote:
>>
>>  We have this configuration
>>>
>>> <configuration>
>>> ...
>>> <conversionRule conversionWord="ourcaller"
>>>        converterClass="com.whatever.****CallerDataConverter" />
>>>
>>> <appender name="jms" class="com.whatever.****JMSQueueAppender">
>>>
>>> <encoder>
>>> <pattern>%d %-5p [%t] %ourcaller{1} - %m%n</pattern>
>>> </encoder>
>>> </appender>
>>>
>>> <appender name="stdout" class="ch.qos.logback.core.****ConsoleAppender">
>>>
>>> <encoder>
>>> <pattern>%d %-5p [%t] %ourcaller{1} %n - %m%n</pattern>
>>> </encoder>
>>> </appender>
>>> ...
>>> ==============================****========
>>>
>>>
>>> This configuration produces these errors:
>>>
>>> 3:21:43,935 |-ERROR in ch.qos.logback.core.joran.spi.****Interpreter at 18
>>> :14
>>>
>>> - no applicable action for [encoder], current pattern is
>>> [[configuration][appender][****encoder]]
>>> 13:21:43,935 |-ERROR in ch.qos.logback.core.joran.spi.****Interpreter at 19
>>> :16
>>>
>>> - no applicable action for [pattern], current pattern is
>>> [[configuration][appender][****encoder][pattern]]
>>>
>>>
>>> The line numbers here refer to the JMSQueueAppender.  The console
>>> appender
>>> which is structured basically identically has no such problem.
>>>
>>> What is Joran trying to tell me here.  It appears to be telling me the
>>> pattern I am using, but does not tell me why it finds this objectionable.
>>>
>>> Thanks.
>>> ______________________________****_________________
>>> Logback-user mailing list
>>> Logback-user at qos.ch
>>> http://mailman.qos.ch/mailman/****listinfo/logback-user<http://mailman.qos.ch/mailman/**listinfo/logback-user>
>>> <http:/**/mailman.qos.ch/mailman/**listinfo/logback-user<http://mailman.qos.ch/mailman/listinfo/logback-user>
>>> >
>>>
>>>
>>
>>
>> ______________________________**_________________
>> Logback-user mailing list
>> Logback-user at qos.ch
>> http://mailman.qos.ch/mailman/**listinfo/logback-user<http://mailman.qos.ch/mailman/listinfo/logback-user>
>>
>
> ______________________________**_________________
> Logback-user mailing list
> Logback-user at qos.ch
> http://mailman.qos.ch/mailman/**listinfo/logback-user<http://mailman.qos.ch/mailman/listinfo/logback-user>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qos.ch/pipermail/logback-user/attachments/20111117/94201638/attachment.html>


More information about the Logback-user mailing list