mirror of
https://github.com/MarginaliaSearch/MarginaliaSearch.git
synced 2025-02-24 05:18:58 +00:00
(qs) Improve logging
This commit is contained in:
parent
def36719d3
commit
6102fd99bf
@ -7,6 +7,8 @@ import nu.marginalia.functions.searchquery.QueryGRPCService;
|
|||||||
import nu.marginalia.service.discovery.property.ServicePartition;
|
import nu.marginalia.service.discovery.property.ServicePartition;
|
||||||
import nu.marginalia.service.server.BaseServiceParams;
|
import nu.marginalia.service.server.BaseServiceParams;
|
||||||
import nu.marginalia.service.server.Service;
|
import nu.marginalia.service.server.Service;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
import spark.Spark;
|
import spark.Spark;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@ -14,6 +16,8 @@ import java.util.List;
|
|||||||
|
|
||||||
public class QueryService extends Service {
|
public class QueryService extends Service {
|
||||||
|
|
||||||
|
private static final Logger logger = LoggerFactory.getLogger(QueryService.class);
|
||||||
|
|
||||||
@SneakyThrows
|
@SneakyThrows
|
||||||
@Inject
|
@Inject
|
||||||
public QueryService(BaseServiceParams params,
|
public QueryService(BaseServiceParams params,
|
||||||
@ -31,6 +35,9 @@ public class QueryService extends Service {
|
|||||||
|
|
||||||
Spark.exception(Exception.class, (e, request, response) -> {
|
Spark.exception(Exception.class, (e, request, response) -> {
|
||||||
response.status(500);
|
response.status(500);
|
||||||
|
|
||||||
|
logger.info("Exception in query service", e);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
e.printStackTrace(response.raw().getWriter());
|
e.printStackTrace(response.raw().getWriter());
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
|
Loading…
Reference in New Issue
Block a user