Hi Jeff,
JENA-2168 is a one line (!) fix.
Adding ShEx (!!) brought in some test code ... and test code needs
logging ... so the logging for test setup got dragged in.
My preference is to avoid touching the downloaded bytes of any system I
have because then upgrade is "replace" without risk of loosing local
modifications.
A slight tweak would be:
if [ -z "$LOGGING" ]
then
DFT_LOG_CONF="$FUSEKI_HOME/log4j2.properties"
LOGGING="-Dlog4j.configurationFile=$DFT_LOG_CONF"
fi
exec $JAVA $JVM_ARGS $LOGGING -cp "$CP" ...
making LOGGING optional and falling back to the built-in setting. There
is always a default - it's hardcoded into the Java and the same as the
log4j2.properties in the download which is meant as an example to start
from - e.g. wanting logging to go to a particular file.
Glad to hear there's a local workaround,
Andy
On 22/09/2021 00:00, Jeff Lerman wrote:
(ugh - for those following at home - my first "solution" has an extra line "
JVM_ARGS=${JVM_ARGS:--Xmx4G}" which was already in the script - I should
not have described that as an additional line).
On Tue, Sep 21, 2021 at 3:58 PM Jeff Lerman <[email protected]> wrote:
Thanks Andy, that definitely put me on the right track!
I prefer not to copy the properties file into the current directory since
that seems a bit brittle - but I tried two other approaches, both of which
worked for me:
1. Edit the fuseki-server script to define an environment variable for
indicating where the lgo4j2.properties file lives, and setting a default if
it's not pre-set. Basically I replaced the "exec $JAVA..." line with this:
JVM_ARGS=${JVM_ARGS:--Xmx4G}
if [ -z "$LOG4J_PROPFILE" ]
then
LOG4J_PROPFILE="$FUSEKI_HOME/log4j2.properties"
fi
exec $JAVA $JVM_ARGS -Dlog4j.configurationFile=$LOG4J_PROPFILE -cp "$CP"
org.apache.jena.fuseki.cmd.FusekiCmd "$@"
2. Lighter-weight, perhaps: Just add the property file setting to
JVM_ARGS. That works, but is a bit of a hassle since ideally it uses
shell-variable interpolation, which is weirdly painful in my CI/CD
environment (I'm using CircleCI). But to do it that way, I just ran:
export JVM_ARGS="-Dlog4j.configurationFile=$FUSEKI_HOME/log4j2.properties"
before calling fuseki-server.
—Jeff
On Tue, Sep 21, 2021 at 1:09 PM Andy Seaborne <[email protected]> wrote:
Hi Jeff,
The server is not finding the right logging configuration - the output
looks like Jena command line format, not the Fuseki format. I don't why
that should happen but it does.
For now: copy the log4j2.properties in the distribution into the current
directory then run the server. Could you confirm that works for you
please? - it did for me. You can also edit the script and put the log4j2
into the java arguments.
Re: "WARN IniRealm" - you can ignore it. In fact, the correct default
logging setup has an explicit setting to suppress it.
Andy
Recorded as:
https://issues.apache.org/jira/browse/JENA-2168
On 21/09/2021 19:21, Jeff Lerman wrote:
Hi,
I noticed that the console-logging in Fuseki, when started with the
fuseki-server script, looks pretty different. I assume this is a
result of
the switch to Jetty 10?
Among other things, the date is no longer included in the log output -
can
that be added back?
Example (Jena/Fuseki 4.1.0):
% ./apache-jena-fuseki/fuseki-server --port 7056
--config=/Users/nope/configs/fuseki-config.ttl
[2021-09-21 01:00:06] Server INFO Apache Jena Fuseki 4.1.0
[2021-09-21 01:00:06] Config INFO
FUSEKI_HOME=/Users/nope/apache-jena-fuseki-4.1.0
[2021-09-21 01:00:06] Config INFO FUSEKI_BASE=/Users/nope/run
[2021-09-21 01:00:06] Config INFO Shiro file:
file:///Users/nope/run/shiro.ini
[2021-09-21 01:00:06] Config INFO Configuration file:
/Users/nope/configs/fuseki-config.ttl
[2021-09-21 01:00:06] Server INFO Path = /SIR
[2021-09-21 01:00:06] Server INFO System
[2021-09-21 01:00:06] Server INFO Memory: 4.0 GiB
[2021-09-21 01:00:06] Server INFO Java: 11.0.7
[2021-09-21 01:00:06] Server INFO OS: Mac OS X 10.15.7 x86_64
[2021-09-21 01:00:06] Server INFO PID: 49283
[2021-09-21 01:00:06] Server INFO Started 2021/09/21 01:00:06 PDT
on
port 7056
Same config file, now with Jena/Fuseki 4.2.0:
% ./apache-jena-fuseki/fuseki-server --port 7056
--config=/Users/nope/configs/fuseki-config.ttl
01:00:55 INFO Server :: jetty-10.0.6; built:
2021-06-29T15:28:56.259Z;
git: 37e7731b4b142a882d73974ff3bec78d621bd674; jvm 11.0.7+10
01:00:55 INFO StandardDescriptorProcessor :: NO JSP Support for /, did
not
find org.eclipse.jetty.jsp.JettyJspServlet
01:00:55 INFO DefaultSessionIdManager :: Session workerName=node0
01:00:55 INFO org_apache_jena_fuseki_Servlet :: Initializing Shiro
environment
01:00:55 INFO EnvironmentLoader :: Starting Shiro environment
initialization.
01:00:55 WARN IniRealm :: Users or Roles are already populated.
Configured Ini instance will be ignored.
01:00:55 INFO EnvironmentLoader :: Shiro environment initialized in
119 ms.
01:00:56 INFO ContextHandler :: Started o.e.j.w.WebAppContext@5d4ea1a4
{Apache
Jena Fuseki
Server,/,file:///Users/nope/apache-jena-fuseki-4.2.0/webapp/,AVAILABLE}
01:00:56 INFO AbstractConnector :: Started ServerConnector@d2c929cf
{HTTP/1.1,
(http/1.1)}{0.0.0.0:7056}
01:00:56 INFO Server :: Started Server@1ce400c8
{STARTING}[10.0.6,sto=0]
@1629ms
The earlier log format seemed much more informative, though I recognize
that some redundancy has been removed in the new one.
Also: Is the new WARN line just due to increased verbosity, or is it
indicative of a problem?
Thanks!
--Jeff