Here are the examples of the java api play.Logger.info() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
11 Examples
19
Source : RecommendationEvaluator.java
with MIT License
from grouplens
with MIT License
from grouplens
public Evaluation evaluate(RequestContext requestContext) {
Logger.info("Note that the input evaluation data must be sorted by the group keys, e.g. groupId");
GroupedEnreplacedyList groupedEnreplacedyList = new GroupedEnreplacedyList(groupKeys, null, enreplacedyDAO);
List<ObjectNode> enreplacedyList;
int cnt = 0;
int skipped = 0;
while ((enreplacedyList = groupedEnreplacedyList.getNextGroup()).size() > 0) {
enreplacedyList = ExpanderUtilities.expand(enreplacedyList, expanders, requestContext);
if (enreplacedyList.size() > 0) {
getRecommendationMetrics(requestContext, enreplacedyList);
cnt++;
if (cnt % 10000 == 0) {
Logger.info("Evaluated on {} groups.", cnt);
}
} else {
skipped++;
}
}
Logger.info("Evaluated on {} groups.", cnt);
Logger.info("Skipped {} groups to evaluate on because of empty ground truth.", skipped);
List<MetricResult> metricResults = EvaluatorUtilities.indexMetrics(recommender.getConfig(), requestContext, metrics, indexers);
return new Evaluation(metricResults);
}
19
Source : SlackSecrets.java
with Apache License 2.0
from EskaleraInc
with Apache License 2.0
from EskaleraInc
private void initSecrets() {
Logger.info("Fetching Slack Secretsfrom AWS Secrets Manager...");
_clientId = System.getenv("SLACK_CLIENT_ID");
_clientSecret = System.getenv("SLACK_CLIENT_SECRET");
_slackSigningSecret = System.getenv("SLACK_SIGNING_SECRET");
_slackToken = System.getenv("SLACK_TOKEN");
_slackBotUserOAuthToken = System.getenv("BOT_USER_OAUTH_TOKEN");
_botId = System.getenv("APP_BOT_ID");
_botUserName = System.getenv("APP_BOT_USERNAME");
_slackAppOauthToken = System.getenv("SLACK_APP_OAUTH_TOKEN");
}
19
Source : SlackSecrets.java
with Apache License 2.0
from EskaleraInc
with Apache License 2.0
from EskaleraInc
public static void init() {
Logger.info("Initializing Slack Secrets...");
if (INSTANCE == null) {
INSTANCE = new SlackSecrets();
INSTANCE.initSecrets();
}
}
18
Source : LoggingFilter.java
with Apache License 2.0
from reljicd
with Apache License 2.0
from reljicd
@Override
public CompletionStage<Result> apply(Function<Http.RequestHeader, CompletionStage<Result>> nextFilter, Http.RequestHeader requestHeader) {
long startTime = System.currentTimeMillis();
return nextFilter.apply(requestHeader).thenApply(result -> {
long endTime = System.currentTimeMillis();
long requestTime = endTime - startTime;
if (!requestHeader.uri().contains("replacedets")) {
Logger.info("{} {} from {} took {}ms and returned {}", requestHeader.method(), requestHeader.uri(), requestHeader.remoteAddress(), requestTime, result.status());
}
return result;
});
}
18
Source : PredictionEvaluator.java
with MIT License
from grouplens
with MIT License
from grouplens
public Evaluation evaluate(RequestContext requestContext) {
if (groupKeys != null && groupKeys.size() > 0) {
Logger.info("Note that the input evaluation data must be sorted by the group keys, e.g. groupId");
}
GroupedEnreplacedyList groupedEnreplacedyList = new GroupedEnreplacedyList(groupKeys, 1, enreplacedyDAO);
List<ObjectNode> enreplacedyList;
int cnt = 0;
int skipped = 0;
while ((enreplacedyList = groupedEnreplacedyList.getNextGroup()).size() > 0) {
enreplacedyList = ExpanderUtilities.expand(enreplacedyList, expanders, requestContext);
if (enreplacedyList.size() > 0) {
getPredictionMetrics(requestContext, enreplacedyList);
cnt++;
if (cnt % 10000 == 0) {
Logger.info("Evaluated on {} groups.", cnt);
}
} else {
skipped++;
}
}
Logger.info("Evaluated on {} groups.", cnt);
Logger.info("Skipped {} groups to evaluate on because of empty ground truth.", skipped);
List<MetricResult> metricResults = EvaluatorUtilities.indexMetrics(predictor.getConfig(), requestContext, metrics, indexers);
return new Evaluation(metricResults);
}
17
Source : LoggerBasedIndexer.java
with MIT License
from grouplens
with MIT License
from grouplens
public void index(RequestContext requestContext) {
Logger.info(requestContext.getRequestBody().toString());
}
16
Source : LoggerBasedIndexer.java
with MIT License
from grouplens
with MIT License
from grouplens
public void index(JsonNode doreplacedents, RequestContext requestContext) {
Logger.info(doreplacedents.toString());
}
16
Source : ElasticSearchService.java
with MIT License
from grouplens
with MIT License
from grouplens
protected void startUp() {
Logger.info("Starting SearchService");
{
Logger.debug("ElasticSearch settings:");
Logger.debug("* cluster.name={}", cfgClusterName);
Logger.debug("* host={}", cfgHost);
Logger.debug("* port={}", cfgPort);
}
final Settings settings = Settings.settingsBuilder().put("cluster.name", cfgClusterName).build();
try {
client = TransportClient.builder().settings(settings).build().addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName(cfgHost), cfgPort));
} catch (UnknownHostException e) {
throw new ConfigurationException(e);
}
Logger.info("Connected to an elasticsearch client");
}
12
Source : FeatureKnnModel.java
with MIT License
from grouplens
with MIT License
from grouplens
public FeatureKnnModel buildModel() {
List<String> features = Lists.newArrayList(svdFeature.getFactorFeatures(minSupport).keySet());
IntList svdIndices = new IntArrayList();
IntList simIndices = new IntArrayList(features.size());
for (int i = 0; i < features.size(); i++) {
String feature = features.get(i);
Map<String, String> attrVals = FeatureExtractorUtilities.decomposeKey(feature);
boolean ifModel = true;
if (attrVals.size() == feaAttrs.size()) {
for (String attr : feaAttrs) {
if (!attrVals.containsKey(attr)) {
ifModel = false;
}
}
} else {
ifModel = false;
}
if (ifModel) {
svdIndices.add(i);
ensureKey(feature);
simIndices.add(getIndexByKey(feature));
} else {
simIndices.add(-1);
}
}
Logger.info("Total number of items to compute similarity model {}: {}", modelName, svdIndices.size());
svdIndices.parallelStream().forEach(curIdx -> {
int simIdx = simIndices.getInt(curIdx);
List<double[]> neighbors = getNeighbors(curIdx, svdIndices, svdFeature, features);
RealVector sims = getIndexVector(simIdx);
for (int j = 0; j < neighbors.size(); j++) {
double[] neighbor = neighbors.get(j);
sims.setEntry(j * 2, simIndices.getInt((int) neighbor[0]));
sims.setEntry(j * 2 + 1, neighbor[1]);
}
setIndexVector(simIdx, sims);
});
return this;
}
11
Source : DirectoryBackupQuartzJob.java
with MIT License
from grouplens
with MIT License
from grouplens
public void execute(JobExecutionContext context) {
JobDataMap dataMap = context.getMergedJobDataMap();
Configuration jobConfig = (Configuration) dataMap.get("jobConfig");
DateFormat format = new SimpleDateFormat("yyyy-MM-dd_HH:mm:ss");
for (Configuration taskConfig : jobConfig.getConfigList("tasks")) {
String sourceDir = taskConfig.getString("sourceDir");
String destDir = taskConfig.getString("destDir");
Date now = new Date();
String dateStr = format.format(now);
Logger.info("Directory backup job is working: {}", taskConfig.underlying().root().render(ConfigRenderOptions.concise()));
try {
File target = new File(Paths.get(destDir, dateStr).toString());
FileUtils.copyDirectory(new File(sourceDir), target);
} catch (IOException e) {
Logger.error(e.getMessage());
}
String reserveStr = taskConfig.getString("reserve");
if (reserveStr != null) {
String[] fields = reserveStr.split(" ", -1);
Date cutDate = new Date(now.getTime() - TimeUnit.valueOf(fields[1]).toMillis(Long.parseLong(fields[0])));
File[] prevDirs = new File(destDir).listFiles(File::isDirectory);
for (File dir : prevDirs) {
try {
Date curDate = format.parse(dir.getName());
if (curDate.before(cutDate)) {
FileUtils.deleteDirectory(dir);
}
} catch (IOException | ParseException e) {
Logger.error(e.getMessage());
}
}
}
}
}
0
Source : ComponentGetterQuartzJob.java
with MIT License
from grouplens
with MIT License
from grouplens
public void execute(JobExecutionContext context) {
JobDataMap dataMap = context.getMergedJobDataMap();
String engineName = dataMap.getString("engineName");
Injector injector = (Injector) dataMap.get("injector");
SamanthaConfigService configService = injector.instanceOf(SamanthaConfigService.clreplaced);
Configuration jobConfig = (Configuration) dataMap.get("jobConfig");
for (Configuration taskConfig : jobConfig.getConfigList("tasks")) {
ObjectNode reqBody = Json.newObject();
for (Configuration indexedData : taskConfig.getConfigList("indexerData")) {
RequestContext pseudoRequest = new RequestContext(Json.parse(indexedData.getConfig(ConfigKey.REQUEST_CONTEXT.get()).underlying().root().render(ConfigRenderOptions.concise())), engineName);
Indexer indexer = configService.getIndexer(indexedData.getString("indexerName"), pseudoRequest);
reqBody.set(indexedData.getString("daoConfigKey"), indexer.getIndexedDataDAOConfig(pseudoRequest));
}
for (Configuration otherData : taskConfig.getConfigList("otherData")) {
reqBody.set(otherData.getString("daoConfigKey"), Json.parse(otherData.getConfig("daoConfig").underlying().root().render(ConfigRenderOptions.concise())));
}
Configuration runnerConfig = taskConfig.getConfig("runner");
IOUtilities.parseEnreplacedyFromJsonNode(Json.parse(runnerConfig.getConfig(ConfigKey.REQUEST_CONTEXT.get()).underlying().root().render(ConfigRenderOptions.concise())), reqBody);
RequestContext pseudoRequest = new RequestContext(reqBody, engineName);
String name = runnerConfig.getString(ConfigKey.ENGINE_COMPONENT_NAME.get());
String type = runnerConfig.getString(ConfigKey.ENGINE_COMPONENT_TYPE.get());
ObjectNode logInfo = Json.newObject();
logInfo.put(ConfigKey.ENGINE_NAME.get(), engineName);
logInfo.put(ConfigKey.ENGINE_COMPONENT_NAME.get(), name);
logInfo.put(ConfigKey.ENGINE_COMPONENT_TYPE.get(), type);
logInfo.set(ConfigKey.REQUEST_CONTEXT.get(), reqBody);
Logger.info(logInfo.toString());
EngineComponent.valueOf(type).getComponent(configService, name, pseudoRequest);
}
}