You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by "Andy Seaborne (Jira)" <ji...@apache.org> on 2020/05/27 21:47:00 UTC

[jira] [Commented] (JENA-1902) Jena riot command printing errors to stdout not stderr

    [ https://issues.apache.org/jira/browse/JENA-1902?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17118123#comment-17118123 ] 

Andy Seaborne commented on JENA-1902:
-------------------------------------

[~rybesh] – thanks for the report.

A workaround for 3.15.0 is to use the fact that you can pass in the name of a configuration file with:

{noformat}
// Linux and Mac:
LOGGING=-Dlog4j.configurationFile=file:log4j2.properties riot ....
{noformat}

so that if there is a {{log4j2.properties}} file in the directory where {{riot}} is run, that will be used in place of the built-in one.

Code built in settings:
 [https://github.com/apache/jena/blob/jena-3.15.0/jena-base/src/main/java/org/apache/jena/atlas/logging/LogCtl.java#L241]

Shipped file with the same in it:
 [https://github.com/apache/jena/blob/jena-3.15.0/apache-jena/log4j2.properties]

Add a line in the appender.console section:
{noformat}
appender.console.target = SYSTEM_ERR
{noformat}
to get stderr output.

> Jena riot command printing errors to stdout not stderr
> ------------------------------------------------------
>
>                 Key: JENA-1902
>                 URL: https://issues.apache.org/jira/browse/JENA-1902
>             Project: Apache Jena
>          Issue Type: Bug
>          Components: Cmd line tools
>    Affects Versions: Jena 3.15.0
>         Environment: Linux 5.4.0-31-generic Ubuntu SMP
>            Reporter: Ryan Shaw
>            Assignee: Andy Seaborne
>            Priority: Major
>
> Staring with Jena 3.15.0 the riot command in printing warnings and errors to stdout rather than stderr. This results in invalid results if stdout is redirected to a file, as logging messages are mixed with data.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)