You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Scott Henninger <Sc...@ecstech.com> on 2024/08/28 20:41:30 UTC

RE: [EXTERNAL] Re: Configuring logging in Fuseki

That works nicely, thank you for the worked out example, Øyvind.

A follow-up question.  I noticed that queries are logged, but not updates (i.e. SPARQL update).  Is there a logger configuration specifically for updates?  Logging queries is fine but I’d also like to know when and how my data is updated.

Thanks in advance,
-- Scott

From: Øyvind Gjesdal <oy...@gmail.com>
Sent: Tuesday, August 27, 2024 3:17 PM
To: users@jena.apache.org
Subject: [EXTERNAL] Re: Configuring logging in Fuseki

CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.

I would expect the log to appear in the console, e.g powershell if started
from powershell, since the default configuration configures a console
appender, or in a IDE console window, if started from there.

To write to a log file you can add a file appender (
https://logging.apache.org/log4j/2.x/manual/appenders.html#fileappender)<https://logging.apache.org/log4j/2.x/manual/appenders.html#fileappender)> to
the properties file.

I tried adding these lines and they created and started logging to the
defined fileName logfile.

+ appender.file.type = File

+ appender.file.name = FILE

+ appender.file.fileName = fuseki.log

+ appender.file.layout.type = PatternLayout

+ appender.file.layout.pattern = %d{HH:mm:ss} %-5p %-15c{1} :: %m%n



...


+ rootLogger.appenderRef.file.ref = FILE


Best regards,

Øyvind


On Tue, Aug 27, 2024 at 7:09 PM Scott Henninger <Sc...@ecstech.com>>
wrote:

> Thanks, Øyvind, Andy, for your responses. I have a pretty basic
> question. I have the default settings in log4j2.properties, but see no
> indication that anything is getting logged. For example. When I look in
> run/logs, it is empty. Where should logs appear on default and/or how so I
> set logging to write the log to a file? I am running on Windows with
> Fuseki 5.1.0.
>
> Thanks in advance,
> -- Scott
>
> From: Andy Seaborne <an...@apache.org>>
> Sent: Saturday, August 24, 2024 9:49 AM
> To: users@jena.apache.org<ma...@jena.apache.org>
> Subject: [EXTERNAL] Re: Configuring logging in Fuseki
>
> CAUTION: This email originated from outside of the organization. Do not
> click links or open attachments unless you recognize the sender and know
> the content is safe.
>
>
>
> On 23/08/2024 18:39, Øyvind Gjesdal wrote:
> > Hi Scott,
> >
> > I think you are right. There is more info on logging for fuseki in
> > https://jena.apache.org/documentation/fuseki2/fuseki-logging.html<https://jena.apache.org/documentation/fuseki2/fuseki-logging.html><
> https://jena.apache.org/documentation/fuseki2/fuseki-logging.html<https://jena.apache.org/documentation/fuseki2/fuseki-logging.html>> which
> > also contains a link to a default file you can fit to your needs.
> >
> > Best regards,
> > Øyvind
>
> Yes, and in addition, if you want to take complete complete control of
> logging you can configure log4j directly by setting the environment
> variable LOGGING (see the fuskei-server script).
>
> e.g.
>
> export LOGGING="-Dlog4j.configurationFile=file:...."
>
> and use XML or JSON formats.
>
> >
> > On Fri, Aug 23, 2024 at 7:21 PM Scott Henninger <
> Scott.Henninger@ecstech.com<ma...@ecstech.com>>>
> > wrote:
> >
> >> Is it possible to configure logging from the command line for Fuseki? I
> >> found the following link that indicates it looks for the file
> >> log4j2.properties, but I don't see anything about what goes in that
> >> properties Apache Jena - Running Fuseki with UI<
> >>
> https://jena.apache.org/documentation/fuseki2/fuseki-webapp.html#configuring-logging<https://jena.apache.org/documentation/fuseki2/fuseki-webapp.html#configuring-logging>
> <
> https://jena.apache.org/documentation/fuseki2/fuseki-webapp.html#configuring-logging<https://jena.apache.org/documentation/fuseki2/fuseki-webapp.html#configuring-logging>
> >
> >>>
> >>
> >> First of all is it true that configuring logging is a matter of
> including
> >> the log4j2.properties file and if so what should appear in the file to
> set
> >> logging levels?
> >>
> >> Thank you
> >> -- Scott
> >>
> >
>

Configuring logging in Fuseki

Posted by Scott Henninger <Sc...@ecstech.com>.
Thank you for your response, Andy.  I wouldn’t expect the full update to be logged, although I am curious how the verbose mode can be switched on.  I think a summary, on the lines of how SPARQL queries are logged with just the query itself.

I will submit an issue for review.

Thanks again
-- Scott

From: Andy Seaborne <an...@apache.org>
Sent: Thursday, August 29, 2024 8:25 AM
To: users@jena.apache.org
Subject: Re: [EXTERNAL] Re: Configuring logging in Fuseki

CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.

Hi Scott,

They are not logged normally - they are in verbose mode.

There are some issues with logging them due to scaling issues.

* Update can be very large
* Update request are streamed

Because of streaming, the whole text is not available at the point of
logging (at the operation start).

An update request can be many operations and each operation is executed
(but not committed) before the next one is read and processed.

Something like:

INSERT DATA {
....
} ;
INSERT DATA {
....
} ;
DELETE DATA {
....
} ;
INSERT DATA {
....
} ;

Adding large amounts of data is often better done by POSTing RDF.
RDF patch can be better, but not a standard, for a mix of adds and deletes.

Maybe the use of "small updates" dominates usage and could be logged.

Do you want the whole update logged or would a summary be sufficient?

Please do raise a issue at
https://github.com/apache/jena/issues<https://github.com/apache/jena/issues>

and we can gather input.

Andy

On 28/08/2024 21:41, Scott Henninger wrote:
> That works nicely, thank you for the worked out example, Øyvind.
>
> A follow-up question. I noticed that queries are logged, but not updates (i.e. SPARQL update). Is there a logger configuration specifically for updates? Logging queries is fine but I’d also like to know when and how my data is updated.
>
> Thanks in advance,
> -- Scott

Re: [EXTERNAL] Re: Configuring logging in Fuseki

Posted by Andy Seaborne <an...@apache.org>.
Hi Scott,

They are not logged normally - they are in verbose mode.

There are some issues with logging them due to scaling issues.

* Update can be very large
* Update request are streamed

Because of streaming, the whole text is not available at the point of 
logging (at the operation start).

An update request can be many operations and each operation is executed 
(but not committed) before the next one is read and processed.

Something like:

INSERT DATA {
   ....
} ;
INSERT DATA {
   ....
} ;
DELETE DATA {
   ....
} ;
INSERT DATA {
   ....
} ;

Adding large amounts of data is often better done by POSTing RDF.
RDF patch can be better, but not a standard, for a mix of adds and deletes.

Maybe the use of "small updates" dominates usage and could be logged.

Do you want the whole update logged or would a summary be sufficient?

Please do raise a issue at
https://github.com/apache/jena/issues

and we can gather input.

     Andy

On 28/08/2024 21:41, Scott Henninger wrote:
> That works nicely, thank you for the worked out example, Øyvind.
> 
> A follow-up question.  I noticed that queries are logged, but not updates (i.e. SPARQL update).  Is there a logger configuration specifically for updates?  Logging queries is fine but I’d also like to know when and how my data is updated.
> 
> Thanks in advance,
> -- Scott