Skip to content

Commit

Permalink
Fix redundant logs and add throwable print.
Browse files Browse the repository at this point in the history
Change-Id: I401ac0ff7db3d951b0c6129f873a6f07fbd2a9eb
  • Loading branch information
margaretha committed Aug 2, 2024
1 parent 1df4f6d commit ae1ca62
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
12 changes: 9 additions & 3 deletions src/main/java/de/ids_mannheim/korap/init/NamedVCLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,12 @@ else if (VirtualCorpusCache.contains(vcId)) {

long start, end;
start = System.currentTimeMillis();
VirtualCorpusCache.store(vcId, searchKrill.getIndex());
try {
VirtualCorpusCache.store(vcId, searchKrill.getIndex());
}
catch (Exception e) {
jlog.error("Failed caching vc "+vcId, e);
}
end = System.currentTimeMillis();
jlog.info("Duration : {}", (end - start));
config.setVcInCaching("");
Expand All @@ -239,13 +244,14 @@ else if (VirtualCorpusCache.contains(vcId)) {
private void storeVCinDB (String vcId, String koralQuery, QueryDO existingVC) {
try {
String info = (existingVC == null) ? "Storing" : "Updating";
jlog.info("{} {} in database ", info, vcId);
jlog.info("{} {} in the database ", info, vcId);

vcService.storeQuery(existingVC, "system", vcId, ResourceType.SYSTEM,
QueryType.VIRTUAL_CORPUS, koralQuery, null, null, null,
true, "system", null, null);
}
catch (KustvaktException e) {
catch (Exception e) {
jlog.error("Failed storing VC: "+vcId, e);
throw new RuntimeException(e);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
public class KustvaktServer extends KustvaktBaseServer {

public static void main (String[] args) throws Exception {
System.setProperty("log4j.configurationFile", "data/log4j2.properties, log4j2.properties");
System.setProperty("log4j.configurationFile", "data/log4j2.properties");
KustvaktServer server = new KustvaktServer();
kargs = server.readAttributes(args);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ appender.file.type = File
appender.file.name = MAINLOG
appender.file.fileName=./data/logs/kustvakt.log
appender.file.layout.type=PatternLayout
appender.file.layout.pattern= %d{yyyy-MM-dd, HH:mm:ss} %C{6} - %M%n %-5p: %m%n
appender.file.layout.pattern= %d{yyyy-MM-dd, HH:mm:ss} %C{6} - %M%n %-5p: %m%n%xEx%n

appender.ldapFile.type = File
appender.ldapFile.name = LDAP_LOG
Expand Down

0 comments on commit ae1ca62

Please sign in to comment.