[
https://issues.apache.org/jira/browse/EAGLE-1075?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16347461#comment-16347461
]
ASF GitHub Bot commented on EAGLE-1075:
---------------------------------------
Github user jhsenjaliya commented on a diff in the pull request:
https://github.com/apache/eagle/pull/978#discussion_r165162632
--- Diff:
eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/main/java/org/apache/eagle/alert/engine/publisher/impl/AlertFilePublisher.java
---
@@ -54,13 +54,26 @@ public void init(Config config, Publishment
publishment, Map conf) throws Except
int numOfFiles = DEFAULT_FILE_NUMBER;
if (publishment.getProperties() != null) {
if
(publishment.getProperties().containsKey(PublishConstants.FILE_NAME)) {
- fileName = (String)
publishment.getProperties().get(PublishConstants.FILE_NAME);
+ String property = (String)
publishment.getProperties().get(PublishConstants.FILE_NAME);
+ if (property != null && !"".equals(property)) {
+ fileName = property;
+ }
}
if
(publishment.getProperties().containsKey(PublishConstants.ROTATE_EVERY_KB)) {
- rotateSize =
Integer.valueOf(publishment.getProperties().get(PublishConstants.ROTATE_EVERY_KB).toString());
+ Object property =
publishment.getProperties().get(PublishConstants.ROTATE_EVERY_KB);
+ if (property instanceof Integer) {
+ rotateSize = (Integer)property;
+ } else if (property instanceof String &&
!"".equals((String)property)) {
--- End diff --
could also check for null once its is instanceof string.
> Can't specify configuration options for AlertFilePublisher
> ----------------------------------------------------------
>
> Key: EAGLE-1075
> URL: https://issues.apache.org/jira/browse/EAGLE-1075
> Project: Eagle
> Issue Type: Improvement
> Reporter: Colm O hEigeartaigh
> Priority: Major
> Fix For: v0.5.1
>
>
> Right now it's not possible to specify the configuration options for the
> AlertFilePublisher in the UI. So for example we can't configure the file
> name/path.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)