sergehuber commented on a change in pull request #266:
URL: https://github.com/apache/unomi/pull/266#discussion_r598992533



##########
File path: 
plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/PropertyConditionEvaluator.java
##########
@@ -418,7 +438,10 @@ private Date getDate(Object value) {
             try {
                 return Date.from(parser.parse(value.toString(), 
System::currentTimeMillis));
             } catch (ElasticsearchParseException e) {
-                logger.warn("unable to parse date " + value.toString(), e);
+                logger.warn("unable to parse date. See debug log level for 
full stacktrace");
+                if (logger.isDebugEnabled()) {
+                    logger.debug("unable to parse date " + value.toString(), 
e);

Review comment:
       Can we replace with parameterized message ?

##########
File path: 
plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/PropertyConditionEvaluator.java
##########
@@ -185,7 +185,10 @@ public boolean eval(Condition condition, Item item, 
Map<String, Object> context,
                 if (!(e instanceof OgnlException)
                         || (!StringUtils.startsWith(e.getMessage(),
                         "source is null for getProperty(null"))) {
-                    logger.warn("Error evaluating value for " + 
item.getClass().getName() + " " + name, e);
+                    logger.warn("Error evaluating value for " + 
item.getClass().getName() + " " + name + ". See debug level for more 
information");

Review comment:
       Can we replace with parameterized message ?

##########
File path: rest/src/main/java/org/apache/unomi/rest/ClusterServiceEndPoint.java
##########
@@ -91,7 +91,10 @@ public void purge(@PathParam("date") String date) {
         try {
             clusterService.purge(new 
SimpleDateFormat("yyyy-MM-dd").parse(date));
         } catch (ParseException e) {
-            logger.error("Cannot purge",e);
+            logger.error("Cannot parse date, expected format is: yyyy-MM-dd. 
See debug log level for more information");
+            if (logger.isDebugEnabled()) {
+                logger.debug("Cannot parse date " + date, e);

Review comment:
       Can we replace with parameterized message ?

##########
File path: 
plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/PropertyConditionEvaluator.java
##########
@@ -185,7 +185,10 @@ public boolean eval(Condition condition, Item item, 
Map<String, Object> context,
                 if (!(e instanceof OgnlException)
                         || (!StringUtils.startsWith(e.getMessage(),
                         "source is null for getProperty(null"))) {
-                    logger.warn("Error evaluating value for " + 
item.getClass().getName() + " " + name, e);
+                    logger.warn("Error evaluating value for " + 
item.getClass().getName() + " " + name + ". See debug level for more 
information");
+                    if (logger.isDebugEnabled()) {
+                        logger.debug("Error evaluating value for " + 
item.getClass().getName() + " " + name, e);

Review comment:
       Can we replace with parameterized message ?

##########
File path: 
plugins/request/src/main/java/org/apache/unomi/plugins/request/actions/SetRemoteHostInfoAction.java
##########
@@ -246,9 +246,9 @@ private static boolean isAValidIPAddress(String remoteAddr) 
{
             try {
                 addr = InetAddress.getByName(remoteAddr);
             } catch (UnknownHostException e) {
-                logger.warn("Cannot resolve IP {}, enable debug log level for 
complete stacktrace", remoteAddr);
+                logger.warn("Cannot resolve IP, enable debug log level for 
complete stacktrace");
                 if (logger.isDebugEnabled()) {
-                    logger.debug("Cannot resolve IP", e);
+                    logger.debug("Cannot resolve IP: " + remoteAddr, e);

Review comment:
       Can we replace with parameterized message ?

##########
File path: 
plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/actions/SetPropertyAction.java
##########
@@ -93,7 +93,10 @@ public int execute(Action action, Event event) {
                     date = event.getTimeStamp();
                 }
             } catch (ParseException e) {
-                logger.error("Error to parse date", e);
+                logger.error("Error parsing firstVisit date property. See 
debug log level for more information");
+                if (logger.isDebugEnabled()) {
+                    logger.debug("Error parsing date: " + propertyFirstVisit, 
e);

Review comment:
       Can we replace with parameterized message ?




-- 
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:
[email protected]


Reply via email to