Re: org.apache.logging.log4j.core.layout.AbstractStringLayout.getContentType() does not use Charset

2018-03-06 Thread Gary Gregory
On Tue, Mar 6, 2018 at 11:01 PM, Apache wrote: > But I would expect getContentType to return a mime type, not a charset. > A content type can contain a charset parameter, for example: Content-type: text/plain; charset=us-ascii See

Re: org.apache.logging.log4j.core.layout.AbstractStringLayout.getContentType() does not use Charset

2018-03-06 Thread Apache
But I would expect getContentType to return a mime type, not a charset. Ralph > On Mar 6, 2018, at 9:17 PM, Gary Gregory wrote: > >> On Tue, Mar 6, 2018 at 6:01 PM, Remko Popma wrote: >> >> Sorry, I don’t follow. >> Why not get the appender’s

Re: org.apache.logging.log4j.core.layout.AbstractStringLayout.getContentType() does not use Charset

2018-03-06 Thread Gary Gregory
On Tue, Mar 6, 2018 at 6:01 PM, Remko Popma wrote: > Sorry, I don’t follow. > Why not get the appender’s layout and get the charset by calling > getCharset()? > Right now, I have this ugly non-OO code: final Layout layout = appender.getLayout();

Re: org.apache.logging.log4j.core.layout.AbstractStringLayout.getContentType() does not use Charset

2018-03-06 Thread Remko Popma
Sorry, I don’t follow. Why not get the appender’s layout and get the charset by calling getCharset()? > On Mar 7, 2018, at 7:21, Gary Gregory wrote: > > Here is my current use case: I'd like to be able to query getContentType() > on an FILE appender (File,

Re: org.apache.logging.log4j.core.layout.AbstractStringLayout.getContentType() does not use Charset

2018-03-06 Thread Gary Gregory
Right. AbstractStringLayout says: @Override public Charset getCharset() { return charset; } /** * @return The default content type for Strings. */ @Override public String getContentType() { return "text/plain"; } Gary On Tue, Mar 6, 2018

Re: org.apache.logging.log4j.core.layout.AbstractStringLayout.getContentType() does not use Charset

2018-03-06 Thread Remko Popma
(Away from pc) by “use”, do you mean that the string returned by getContentType() doesn’t include a charset? From memory, I remember the only place this method is used is in the HtmlAppender. Are there other places? (Shameless plug) Every java main() method deserves http://picocli.info > On