Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BLZG-9177 Use slf4j for logging errors in BigdataRDFServlet #147

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.log4j.Logger;
import org.openrdf.model.Graph;
import org.openrdf.model.Resource;
import org.openrdf.model.Statement;
Expand All @@ -60,6 +59,8 @@
import org.openrdf.rio.RDFWriter;
import org.openrdf.rio.RDFWriterFactory;
import org.openrdf.rio.RDFWriterRegistry;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.bigdata.journal.IAtomicStore;
import com.bigdata.rdf.properties.PropertiesFormat;
Expand All @@ -83,7 +84,7 @@ abstract public class BigdataRDFServlet extends BigdataServlet {
*/
private static final long serialVersionUID = 1L;

static private final transient Logger log = Logger.getLogger(BigdataRDFServlet.class);
static private final transient Logger log = LoggerFactory.getLogger(BigdataRDFServlet.class);

/**
* The name of the <code>UTF-8</code> character encoding.
Expand Down Expand Up @@ -211,7 +212,11 @@ public static void launderThrowable(final Throwable t,
final boolean isQuery = queryStr != null && queryStr.length() > 0;
try {
// log an error for the service.
log.error("cause=" + t + (isQuery ? ", query=" + queryStr : ""), t);
if (isQuery) {
log.error("cause={}, query={}", t, queryStr, t);
} else {
log.error("cause={}", t, t);
}
} finally {
// ignore any problems here.
}
Expand Down Expand Up @@ -572,10 +577,7 @@ static public void sendGraph(final HttpServletRequest req,

if (writerFactory == null) {

if (log.isDebugEnabled()) {
log.debug("No writer for format: format=" + format
+ ", Accept=\"" + acceptStr + "\"");
}
log.debug("No writer for format: format={}, Accept=\"{}\"", format, acceptStr);

format = RDFFormat.RDFXML;

Expand Down