# Using log ports

**URL:** <https://forum.cloverdx.com/t/using-log-ports/934>\
**Category:** CloverDX Platform\
**Created:** [September 16, 2011, 12:00am UTC](https://forum.cloverdx.com/t/using-log-ports/934 "2011-09-16T00:00:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![fschnack](https://avatars.discourse-cdn.com/v4/letter/f/cab0a1/32.png) [@fschnack](https://forum.cloverdx.com/u/fschnack)\
**Post date:** [September 16, 2011, 12:00am UTC](https://forum.cloverdx.com/t/using-log-ports/934/1 "2011-09-16T00:00:00Z")

</div>

Hello!

I am embedding Clover 3.0.2 into a Java application. In my custom node, I wanted to use the logport that is defined in the Node class to write rejected data. The flow execution finishes successfully, but if I try to enable JMX monitoring I start getting NPE on PhaseTrackingDetail line 207.

After some digging, I’ve found that the problem is related to this class’ nodesDetails attribute. This array is initialized with the the same size as the list of graph nodes (see line 63). When it is being populated, the TransformationGraphAnalyzer.nodesTopologicalSorting method is called to sort the nodes list. The problem is that when this method crawls through the nodes, it gets all output ports for all nodes, but it’s not getting the log port. The result is that the PhaseTrackingDetail.nodesDetails attribute ends with some null values.

Would it be possible to fix it in a future release? It’s a quick fix, it’s only a matter of adding the log port to TransformationGraphAnalyzer.findSuccessiveNodes() method.

Another (related) question: shouldn’t Node.closeAllOutputPorts() method call logPort.eof()?

Thanks!!

---

<div class="post-metadata">

**Author:** ![avackova](https://avatars.discourse-cdn.com/v4/letter/a/65b543/32.png) [@avackova](https://forum.cloverdx.com/u/avackova)\
**Post date:** [September 20, 2011, 9:26am UTC](https://forum.cloverdx.com/t/using-log-ports/934/2 "2011-09-20T09:26:13Z")

</div>

Hello,  
log port is not used in CloverETL. It was designed with the Node class in the very beggining of CloverETL, but has been never used and will be removed in 3.2 version. Please use just another output port like it is used in DataReader component.

---

<div class="post-metadata">

**Author:** ![fschnack](https://avatars.discourse-cdn.com/v4/letter/f/cab0a1/32.png) [@fschnack](https://forum.cloverdx.com/u/fschnack)\
**Post date:** [September 20, 2011, 11:28am UTC](https://forum.cloverdx.com/t/using-log-ports/934/3 "2011-09-20T11:28:00Z")

</div>

Oh, really, it was discontinued? I think the documentation still refers to it on the wiki…

The problem with components such as data reader is that in order to implement an optional log port this port is fixed as the second (index = 1) and you can’t add extra ports to it. Is there a pattern on how to implement this feature in Clover?

Thanks!

---

<div class="post-metadata">

**Author:** ![avackova](https://avatars.discourse-cdn.com/v4/letter/a/65b543/32.png) [@avackova](https://forum.cloverdx.com/u/avackova)\
**Post date:** [September 20, 2011, 12:22pm UTC](https://forum.cloverdx.com/t/using-log-ports/934/4 "2011-09-20T12:22:07Z")

</div>

Hello,  
we usually do it with another attribute such as _useLogPort=true/false_ and if this attribute is set to true, the last connected output port is treated as logging port.

---

<div class="post-metadata">

**Author:** ![fschnack](https://avatars.discourse-cdn.com/v4/letter/f/cab0a1/32.png) [@fschnack](https://forum.cloverdx.com/u/fschnack)\
**Post date:** [September 22, 2011, 12:23pm UTC](https://forum.cloverdx.com/t/using-log-ports/934/5 "2011-09-22T12:23:58Z")

</div>

Seems much more complicated… but thanks.
