You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@unomi.apache.org by GitBox <gi...@apache.org> on 2021/01/05 09:46:25 UTC

[GitHub] [unomi] jkevan opened a new pull request #233: UNOMI-412: change some DEBUG log to WARN, ERROR or INFO

jkevan opened a new pull request #233:
URL: https://github.com/apache/unomi/pull/233


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [unomi] sergehuber merged pull request #233: UNOMI-412: change some DEBUG log to WARN, ERROR or INFO

Posted by GitBox <gi...@apache.org>.
sergehuber merged pull request #233:
URL: https://github.com/apache/unomi/pull/233


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [unomi] dgriffon commented on a change in pull request #233: UNOMI-412: change some DEBUG log to WARN, ERROR or INFO

Posted by GitBox <gi...@apache.org>.
dgriffon commented on a change in pull request #233:
URL: https://github.com/apache/unomi/pull/233#discussion_r551869544



##########
File path: graphql/cxs-impl/src/main/java/org/apache/unomi/graphql/commands/ProcessEventsCommand.java
##########
@@ -104,7 +104,7 @@ private void processStaticFields(
                         }
 
                     } catch (Exception e) {
-                        LOG.debug("Process field {} is failed", eventProcessor.getFieldName(), e);
+                        LOG.warn("Process field " + eventProcessor.getFieldName() + " is failed", e);

Review comment:
       Can you use the Log formatter instead of the string concat? 
   Also, this can be split in two, warn with the failed field, and keep the stack trace log for the debug. 

##########
File path: graphql/cxs-impl/src/main/java/org/apache/unomi/graphql/commands/ProcessEventsCommand.java
##########
@@ -115,7 +115,7 @@ private void processDynamicFields(final LinkedHashMap<String, Object> eventInput
                 try {
                     processField(fieldDefinition, eventInputAsMap);
                 } catch (Exception e) {
-                    LOG.debug("Process field {} is failed", fieldDefinition, e);
+                    LOG.warn("Process field " + fieldDefinition + " is failed", e);

Review comment:
       Same as above

##########
File path: plugins/request/src/main/java/org/apache/unomi/plugins/request/actions/SetRemoteHostInfoAction.java
##########
@@ -232,7 +232,7 @@ private boolean ipLookupInDatabase(String remoteAddr, Session session) {
             }
             return true;
         } catch (IOException | GeoIp2Exception e) {
-            logger.debug("Cannot resolve IP", e);
+            logger.warn("Cannot resolve IP", e);

Review comment:
       use debug to log the stack trace and only display  the error message as a warning

##########
File path: plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/GeoLocationByPointSessionConditionEvaluator.java
##########
@@ -61,7 +61,7 @@ public boolean eval(Condition condition, Item item, Map<String, Object> context,
                 }
             }
         } catch (Exception e) {
-            logger.debug("Cannot get properties", e);
+            logger.warn("Cannot evaluate condition, properties 'properties.location.lat' or 'properties.location.lon' not found");

Review comment:
       Can you add  a logger.debug(e) to allow one to see why it failed?

##########
File path: plugins/request/src/main/java/org/apache/unomi/plugins/request/actions/SetRemoteHostInfoAction.java
##########
@@ -243,7 +243,7 @@ private static boolean isAValidIPAddress(String remoteAddr) {
             try {
                 addr = InetAddress.getByName(remoteAddr);
             } catch (UnknownHostException e) {
-                logger.debug("Cannot resolve IP", e);
+                logger.warn("Cannot resolve IP", e);

Review comment:
       use debug to log the stack trace and only display  the error message as a warning

##########
File path: services/src/main/java/org/apache/unomi/services/impl/definitions/DefinitionsServiceImpl.java
##########
@@ -268,7 +268,7 @@ private void loadPredefinedValueTypes(BundleContext bundleContext) {
                         valueTypeByTag.put(tag, valueTypes);
                     } else {
                         // we found a tag that is not defined, we will define it automatically
-                        logger.debug("Unknown tag " + tag + " used in property type definition " + predefinedPropertyURL);
+                        logger.warn("Unknown tag " + tag + " used in property type definition " + predefinedPropertyURL);

Review comment:
       use logger formatter here instead of `+`
   (this is really minor)




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org