(qs) Improve logging

This commit is contained in:
Viktor Lofgren 2024-04-18 10:44:08 +02:00
parent 8bbaf457de
commit 975d92912c

View File

@ -7,6 +7,8 @@ import nu.marginalia.functions.searchquery.QueryGRPCService;
import nu.marginalia.service.discovery.property.ServicePartition;
import nu.marginalia.service.server.BaseServiceParams;
import nu.marginalia.service.server.Service;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import spark.Spark;
import java.io.IOException;
@ -14,6 +16,8 @@ import java.util.List;
public class QueryService extends Service {
private static final Logger logger = LoggerFactory.getLogger(QueryService.class);
@SneakyThrows
@Inject
public QueryService(BaseServiceParams params,
@ -31,6 +35,9 @@ public class QueryService extends Service {
Spark.exception(Exception.class, (e, request, response) -> {
response.status(500);
logger.info("Exception in query service", e);
try {
e.printStackTrace(response.raw().getWriter());
} catch (IOException ex) {