Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

device-virtual property overrides in start script may not be working properly #3

Open
tonyespy opened this issue Apr 10, 2018 · 2 comments

Comments

@tonyespy
Copy link
Owner

tonyespy commented Apr 10, 2018

If device-virtual is started from the edgex-core-snap (0.5.1+cali-20180322), the log file (edgex-device-virtual.log) is properly created in $SNAP_COMMON, however the contents of the log file only appear to include spring framework INFO log messages whereas the log messages written to the terminal used to run the start script include DEBUG and ERROR messages.

Here's an example of the messages seen in the log file:

2018-03-22 13:13:09.436 INFO 27577 --- [main] s.c.a.AnnotationConfigApplicationContex
t : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationConte
xt@722c41f4: startup date [Thu Mar 22 13:13:09 EDT 2018]; root of context hierarchy

It also looks like the property override for consul=enabled isn't working properly either, as I if i hit the Consul services UI, device-virtual isn't shown:

http://localhost:8500/ui/#/dc1/services

The command line in bin/start-edgex.sh uses the following command-line to start device-virtual:

$JAVA -jar -Djava.security.egd=file:/dev/urandom -Xmx100M
-Dspring.cloud.consul.enabled=true
-Dlogging.level.org.edgexfoundry=DEBUG
-Dlogging.file=$SNAP_COMMON/edgex-device-virtual.log
-Dapplication.device-profile-paths=$SNAP_COMMON/bacnet_profiles,$SNAP_
COMMON/modbus_profiles
$SNAP/jar/device-virtual/device-virtual.jar &

The snap was installed on an amd64 machine running Ubuntu 16.04 LTS Desktop.

@tonyespy
Copy link
Owner Author

Note, it looks like the property override for consul=enabled isn't working properly, as I if i hit the Consul services UI, device-virtual isn't shown:

http://localhost:8500/ui/#/dc1/services

@tonyespy tonyespy changed the title device-virtual not logging not working properly device-virtual property overrides in start script may not be working properly Apr 10, 2018
@tonyespy
Copy link
Owner Author

It turns out the fact that I was setting spring.cloud.consul.enabled=true is the culprit, at least for the device-profile-paths property. Basically, when consul is enabled, a service reads its properties from Consul, which overrides any local configuration, which includes properties set on the command-line. So for now, I'm changing consul.enabled=false for now.

In order to fix this properly, we'd need to create profile-specific property files for the snap (eg. device-virtual;snap) in core-config-seed, and then specify profile=snap on the command line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant