apache / apache/plc4x

[Feature Request]: show the name of PLC in logged warnings

Open
#2,495 1 comment 0 reactions 0 assignees View on GitHub
java
Dominant language
Java
Stars
1.7k
Forks
504
Avg merge
10h 55m
Merged PRs (30d)
43

Description

### What would you like to happen?

Protocol errors should show some information to identify the PLC where a specific error comes from.

When integrating both the S7 and the S7-light driver, I get some warn logs if parameters are not perfectly right. Especially with connections to multiple PLCs, it becomes impossible to trace these to the related device.
Since most of the logs are executed in some worker thread, also the thread-name can not help.

Most typical example is:

> 11.03.2026 17:45:14.096647 [oopGroup-3-1] WARN o.a.p.j.s.readwrite.protocol.S7ProtocolLogic Got an error response from the PLC. This particular response code usually indicates that PUT/GET is not enabled on the PLC.

Expected message could be like:
"Got an error response from PLC _url_. This particular response code usually indicates that PUT/GET is not enabled on the PLC."

Also it would be relly helpful to distinguish between the error codes for "context not supported", "desired item not available" and other causes.
For example. I always get this log message "... PUT/GET not enabled ..." from different root causes, e.g. (messages from s7connector):
* context is not supported (is that the real PUT/GET not enabled?)
* PUT/GET is enabled but DBS is not defined in the PLC.
* reading more bytes from a DBS than available

Thank you very much, your lib is great!

### Programming Languages

- [x] plc4j
- [ ] plc4go
- [ ] plc4c
- [ ] plc4net

### Protocols

- [ ] AB-Ethernet
- [ ] ADS /AMS
- [ ] BACnet/IP
- [ ] CANopen
- [ ] DeltaV
- [ ] DF1
- [ ] EtherNet/IP
- [ ] Firmata
- [ ] KNXnet/IP
- [ ] Modbus
- [ ] OPC-UA
- [x] S7

Contributor guide

Open the contributing guide

Research direction

Start at the S7ProtocolLogic warning shown in the issue and trace how the PLC connection identity and response codes are available there. Update the warnings so the originating PLC can be identified and the relevant error causes are distinguished; verify the resulting log messages for S7 connections, including S7-light where applicable.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
networking
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.