How do i get any (debug)logs from HTTP Binding(solved)

  • Platform information:
    • Hardware: i7, 7gb ram, 500gb
    • OS: centos
    • Java Runtime Environment:open java

I created an item(below) and when i switch it on/off and use my switch, it works(great!). The log shows KitchenLights on, but the http binding is not working. I see nothing in any log. i turned on global debuging in the console and still nothing in the logs to see what the http binding is doing? How do i see the http binding logs? Am i doing something wrong in my items??

2020-01-10 21:28:14.401 [ome.event.ItemCommandEvent] - Item 'KitchenLights' received command ON
2020-01-10 21:28:14.408 [vent.ItemStateChangedEvent] - KitchenLights changed from NULL to ON


 Switch KitchenLights "Kitchen Lights" <light> (gKitchen) [ "Switchable" ] { http=">[ON:POST:http://0005cd2df566.fios-router.home/MainZone/index.put.asp?cmd0=PutZone_InputFunction%2FSAT/CBL]>[OFF:POST:http://0005cd2df566.fios-router.home/MainZone/index.put.asp?cmd0=PutZone_InputFunction%2FGAME]" }

The same way as for every other binding.

See the taming openHAB logging tutorial for starters.

1 Like

@Marc_W1

In OH2 console:

log:set DEBUG org.openhab.binding.http

To set it back:

log:set DEFAULT org.openhab.binding.http

Thanks but I still not did not see the call in the logs, I was expecting to see something with the url being sent out, but nothing to debug with. Turning debug on, I see 100s of “execute()” which must not be related to my switch . Any help?

2020-01-11 07:50:56.974 [DEBUG] [ab.binding.http.internal.HttpBinding] - 'execute()' called ...
2020-01-11 07:50:57.975 [DEBUG] [ab.binding.http.internal.HttpBinding] - 'execute()' called ...
2020-01-11 07:50:58.975 [DEBUG] [ab.binding.http.internal.HttpBinding] - 'execute()' called ...
2020-01-11 07:50:59.976 [DEBUG] [ab.binding.http.internal.HttpBinding] - 'execute()' called ...
2020-01-11 07:51:00.976 [DEBUG] [ab.binding.http.internal.HttpBinding] - 'execute()' called ...
 
==> /var/log/openhab2/events.log <==
2020-01-11 07:51:01.478 [ome.event.ItemCommandEvent] - Item 'KitchenLights' received command ON
2020-01-11 07:51:01.481 [vent.ItemStateChangedEvent] - KitchenLights changed from OFF to ON

==> /var/log/openhab2/openhab.log <==
2020-01-11 07:51:01.976 [DEBUG] [ab.binding.http.internal.HttpBinding] - 'execute()' called ...
2020-01-11 07:51:02.977 [DEBUG] [ab.binding.http.internal.HttpBinding] - 'execute()' called ...
2020-01-11 07:51:03.977 [DEBUG] [ab.binding.http.internal.HttpBinding] - 'execute()' called ...
2020-01-11 07:51:04.978 [DEBUG] [ab.binding.http.internal.HttpBinding] - 'execute()' called ...

When i touch default.items file, i do see the “compile”, but nothing i see shows an issue.

2020-01-11 07:56:55.111 [DEBUG] [ab.binding.http.internal.HttpBinding] - 'execute()' called ...                                                                                                                                                                                                                                  
2020-01-11 07:56:56.111 [DEBUG] [ab.binding.http.internal.HttpBinding] - 'execute()' called ...                                                                                                                                                                                                                                  
2020-01-11 07:56:57.112 [DEBUG] [ab.binding.http.internal.HttpBinding] - 'execute()' called ...                                                                                                                                                                                                                                  
2020-01-11 07:56:57.905 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'default.items'                                                                                                                                                                                                                        
2020-01-11 07:56:57.907 [DEBUG] [.internal.HttpGenericBindingProvider] - parsing this as an http out binding: ON:POST:http://0005cd2df566.fios-router.home/MainZone/index.put.asp?cmd0=PutZone_InputFunction%2FSAT/CBL]>[OFF:POST:http://0005cd2df566.fios-router.home/MainZone/index.put.asp?cmd0=PutZone_InputFunction%2FGAME  
2020-01-11 07:56:57.908 [DEBUG] [.internal.HttpGenericBindingProvider] - URL portion of binding config to be processed: http://0005cd2df566.fios-router.home/MainZone/index.put.asp?cmd0=PutZone_InputFunction%2FSAT/CBL]>[OFF:POST:http://0005cd2df566.fios-router.home/MainZone/index.put.asp?cmd0=PutZone_InputFunction%2FGAME
2020-01-11 07:56:57.908 [DEBUG] [.internal.HttpGenericBindingProvider] - Group 0: http://0005cd2df566.fios-router.home/MainZone/index.put.asp?cmd0=PutZone_InputFunction%2FSAT/CBL]>[OFF:POST:http://0005cd2df566.fios-router.home/MainZone/index.put.asp?cmd0=PutZone_InputFunction%2FGAME                                      
2020-01-11 07:56:57.908 [DEBUG] [.internal.HttpGenericBindingProvider] - Group 1: http://0005cd2df566.fios-router.home/MainZone/index.put.asp?cmd0=PutZone_InputFunction%2FSAT/CBL]>[OFF                                                                                                                                         
2020-01-11 07:56:57.908 [DEBUG] [.internal.HttpGenericBindingProvider] - Group 2: http:                                                                                                                                                                                                                                          
2020-01-11 07:56:57.908 [DEBUG] [.internal.HttpGenericBindingProvider] - Group 3: http                                                                                                                                                                                                                                           
2020-01-11 07:56:57.909 [DEBUG] [.internal.HttpGenericBindingProvider] - Group 4: //0005cd2df566.fios-router.home                                                                                                                                                                                                                
2020-01-11 07:56:57.909 [DEBUG] [.internal.HttpGenericBindingProvider] - Group 5: 0005cd2df566.fios-router.home                                                                                                                                                                                                                  
2020-01-11 07:56:57.909 [DEBUG] [.internal.HttpGenericBindingProvider] - Group 6: /MainZone/index.put.asp                                                                                                                                                                                                                        
2020-01-11 07:56:57.909 [DEBUG] [.internal.HttpGenericBindingProvider] - Group 7: ?cmd0=PutZone_InputFunction%2FSAT/CBL]>[OFF                                                                                                                                                                                                    
2020-01-11 07:56:57.909 [DEBUG] [.internal.HttpGenericBindingProvider] - Group 8: cmd0=PutZone_InputFunction%2FSAT/CBL]>[OFF                                                                                                                                                                                                     
2020-01-11 07:56:57.909 [DEBUG] [.internal.HttpGenericBindingProvider] - Group 9: null                                                                                                                                                                                                                                           
2020-01-11 07:56:57.909 [DEBUG] [.internal.HttpGenericBindingProvider] - Group 10: null                                                                                                                                                                                                                                          
2020-01-11 07:56:57.910 [DEBUG] [.internal.HttpGenericBindingProvider] - Group 11: :POST:http://0005cd2df566.fios-router.home/MainZone/index.put.asp?cmd0=PutZone_InputFunction%2FGAME                                                                                                                                           
2020-01-11 07:56:58.112 [DEBUG] [ab.binding.http.internal.HttpBinding] - 'execute()' called ...                                                                                                                                                                                                                                  
2020-01-11 07:56:59.112 [DEBUG] [ab.binding.http.internal.HttpBinding] - 'execute()' called ...                                                                                                                                                                                                                                  
2020-01-11 07:57:00.113 [DEBUG] [ab.binding.http.internal.HttpBinding] - 'execute()' called ...                                                                                                                                                                                                                                  

Yesterday when I looked I did not see the binding when i ran “log:get” in the console. Thanks for my obliviousness!

org.openhab.binding.denonreceiver                  │ DEBUG
org.openhab.binding.http                           │ DEBUG
org.openhab.ui.paper                               │ ERROR

I found the issue, the query-string(arguments after the ?) was the issue. “?” can not be used, you must use “:” instead. The http-binding document used “postcontent” as a synonym of a url “query-string”

This works!
Switch KitchenLights “Kitchen Lights” (gKitchen) [ “Switchable” ] { http=">[ON:POST:http://0005cd2df566.fios-router.home/MainZone/index.put.asp:cmd0=PutZone_InputFunction%2FSAT/CBL] >[OFF:POST:http://0005cd2df566.fios-router.home/MainZone/index.put.asp:cmd0=PutZone_InputFunction%2FGAME]" }