mirror of
https://github.com/MarginaliaSearch/MarginaliaSearch.git
synced 2025-02-23 21: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.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) {
|
||||
|
Loading…
Reference in New Issue
Block a user