You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@streampipes.apache.org by GitBox <gi...@apache.org> on 2023/02/11 14:39:26 UTC

[GitHub] [streampipes] flomickl created a discussion: How to write logs that will be prompt in the pipeline show logs tab?

GitHub user flomickl created a discussion: How to write logs that will be prompt in the pipeline show logs tab?

If you click on show pipeline, there is a tab called logs.


![logs](https://user-images.githubusercontent.com/16739072/218263855-7f5bfb40-5487-47c8-b8e6-7dc9ca38f339.png)

How to write logs, so they will be prompt here.
What kind of logs should be logged here anyway (best practice?)
I would output logs if something odd happened during runtime

GitHub link: https://github.com/apache/streampipes/discussions/1262

----
This is an automatically sent email for dev@streampipes.apache.org.
To unsubscribe, please send an email to: dev-unsubscribe@streampipes.apache.org


[GitHub] [streampipes] flomickl added a comment to the discussion: How to write logs that will be prompt in the pipeline show logs tab?

Posted by GitBox <gi...@apache.org>.
GitHub user flomickl added a comment to the discussion: How to write logs that will be prompt in the pipeline show logs tab?

@tenthe I see I see.
What is the best way to get the parameters from the `onInvocation` into the `onEvent`?

It is practical to 
1) define a  `ProcessorParams params;` in general
2) in the onInvocation do `this.params = parameters;`
3) and then use this in the onEvent like
```
      SpMonitoringManager.INSTANCE.addErrorMessage(params.getGraph().getElementId(),
          SpLogEntry.from(System.currentTimeMillis(),
              StreamPipesErrorMessage.from(new SpNotSupportedGeometryException("Point Geometry is not supported"))));
```

?

GitHub link: https://github.com/apache/streampipes/discussions/1262#discussioncomment-5092928

----
This is an automatically sent email for dev@streampipes.apache.org.
To unsubscribe, please send an email to: dev-unsubscribe@streampipes.apache.org


[GitHub] [streampipes] tenthe added a comment to the discussion: How to write logs that will be prompt in the pipeline show logs tab?

Posted by GitBox <gi...@apache.org>.
GitHub user tenthe added a comment to the discussion: How to write logs that will be prompt in the pipeline show logs tab?

You can find an example in the class `PullAdapter` [1] in line 76. This is for adapters, for processing elements you can geht the `elmentId` from the `ProcessParams` in the `onInvocation` method:
``` java
processorParams.getGraph().getElementId()
```

@dominikriemer, is there another way to get the element id or should a developer always use the `procesorParams`?

[1] https://github.com/apache/streampipes/blob/dev/streampipes-extensions/streampipes-connect-adapters-iiot/src/main/java/org/apache/streampipes/connect/iiot/adapters/PullAdapter.java

GitHub link: https://github.com/apache/streampipes/discussions/1262#discussioncomment-5007512

----
This is an automatically sent email for dev@streampipes.apache.org.
To unsubscribe, please send an email to: dev-unsubscribe@streampipes.apache.org


[GitHub] [streampipes] flomickl added a comment to the discussion: How to write logs that will be prompt in the pipeline show logs tab?

Posted by GitBox <gi...@apache.org>.
GitHub user flomickl added a comment to the discussion: How to write logs that will be prompt in the pipeline show logs tab?

Can you provide a small code snippet example?
What do you mean with `elementId` in this context?

GitHub link: https://github.com/apache/streampipes/discussions/1262#discussioncomment-5000736

----
This is an automatically sent email for dev@streampipes.apache.org.
To unsubscribe, please send an email to: dev-unsubscribe@streampipes.apache.org


[GitHub] [streampipes] flomickl added a comment to the discussion: How to write logs that will be prompt in the pipeline show logs tab?

Posted by GitBox <gi...@apache.org>.
GitHub user flomickl added a comment to the discussion: How to write logs that will be prompt in the pipeline show logs tab?

@tenthe 
Is is working and implemented here
https://github.com/apache/streampipes/blob/6a00daffa45ecd0c63b52a1fcfd09f6798895695/streampipes-extensions/streampipes-processors-geo-jvm/src/main/java/org/apache/streampipes/processors/geo/jvm/jts/processor/derivedgeometry/point/CreateDerivedPointProcessor.java#L114

Is there anything to improve the way how I set up the parameter variable here
https://github.com/apache/streampipes/blob/6a00daffa45ecd0c63b52a1fcfd09f6798895695/streampipes-extensions/streampipes-processors-geo-jvm/src/main/java/org/apache/streampipes/processors/geo/jvm/jts/processor/derivedgeometry/point/CreateDerivedPointProcessor.java#L61

and here 
https://github.com/apache/streampipes/blob/6a00daffa45ecd0c63b52a1fcfd09f6798895695/streampipes-extensions/streampipes-processors-geo-jvm/src/main/java/org/apache/streampipes/processors/geo/jvm/jts/processor/derivedgeometry/point/CreateDerivedPointProcessor.java#L105

GitHub link: https://github.com/apache/streampipes/discussions/1262#discussioncomment-5103856

----
This is an automatically sent email for dev@streampipes.apache.org.
To unsubscribe, please send an email to: dev-unsubscribe@streampipes.apache.org


[GitHub] [streampipes] tenthe added a comment to the discussion: How to write logs that will be prompt in the pipeline show logs tab?

Posted by GitBox <gi...@apache.org>.
GitHub user tenthe added a comment to the discussion: How to write logs that will be prompt in the pipeline show logs tab?

Hi @flomickl,
you can do this via the runtime context:
- E.g. in a processor `EventProcessorRuntimeContext` with this method `runtimeContext.getLogger().addErrorMessage()`

GitHub link: https://github.com/apache/streampipes/discussions/1262#discussioncomment-4960109

----
This is an automatically sent email for dev@streampipes.apache.org.
To unsubscribe, please send an email to: dev-unsubscribe@streampipes.apache.org


[GitHub] [streampipes] dominikriemer added a comment to the discussion: How to write logs that will be prompt in the pipeline show logs tab?

Posted by GitBox <gi...@apache.org>.
GitHub user dominikriemer added a comment to the discussion: How to write logs that will be prompt in the pipeline show logs tab?

Currently you need to provide the `elementId` of the processor, but we will probably simplify this in the future!

GitHub link: https://github.com/apache/streampipes/discussions/1262#discussioncomment-4974557

----
This is an automatically sent email for dev@streampipes.apache.org.
To unsubscribe, please send an email to: dev-unsubscribe@streampipes.apache.org