pass vmArg/env/args

本文讨论了如何在SpringBoot项目中通过`launch.json`配置文件设置环境变量LOGDIR,如使用vmArgs、env和args的方式,并提到了在VSCode之外设置这些变量的方法及其不确定性。
摘要由CSDN通过智能技术生成

u can pass properties values by vmArg/env/args sconfigurations of launch.json like below,

so u can use ${LOGDIR} in ur springboot project properties files like ERROR_LOG_DIR=${LOGDIR}/error to get the value.
BUt i dont know it will use which of vmArg/env/args.

"vmArgs": [
    "-DLOGDIR=c:/logs",
],
"env": {                
    "LOGDIR":"c:/logs",
},
"args": [
    "LOGDIR=c:/logs",
]

set the env variables without vscode
u can ‘set LOGDIR=c:/logs’ in cmd in windows,
or ‘export LOGDIR=c:/logs’ in linux.

set the args variables without vscode, i am not sure because it is not tested
java -cp XXX(eg:org.xxxBatch) LOGDIR=c:/logs

set the vmArgs variables without vscode, i am not sure because it is not tested
java -jar --LOGDIR=c:/logs XXXXX.jar
or java -jar -LOGDIR=c:/logs XXXXX.jar??

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值