Skip to content

Preventing connection uri to show in logging #605

@grtjn

Description

@grtjn

I noticed that when running a CorbTask with gradle -i, Gradle will print a 'Starting process' log line that contains the connection uri in full detail:

> Task :deleteDocs
Caching disabled for task ':deleteDocs' because:
  Build cache is disabled
Task ':deleteDocs' is not up-to-date because:
  Task.upToDateWhen is false.
Starting process 'command 'C:\Java\jdk-11\bin\java.exe''. Working directory: D:\Projects\datahub Command: C:\Java\jdk-11\bin\java.exe -DEXPORT-FILE-NAME=deleteDocs.csv -DMODULES-DATABASE=datahub-modules -DOPTIONS-FILE=src/main/ml-modules/root/corb/options.properties -DPROCESS-MODULE=src/main/ml-modules/root/corb/delete-docs-xform.xqy|ADHOC -DPROCESS-TASK=com.marklogic.developer.corb.ExportBatchToFileTask -DTHREAD-COUNT=10 -DURIS-MODULE=src/main/ml-modules/root/corb/delete-docs-uris.xqy|ADHOC -DXCC-CONNECTION-URI=xcc://xxx:yyy@zzz:8140

I have been looking for ways to suppress that line, but seems like JavaExec (which is used under the covers) does not allow suppressing that line when info level logging is enabled: https://github.com/gradle/gradle/blob/b74338910359a112212adb7d0de40b156d4c9c31/subprojects/core/src/main/java/org/gradle/process/internal/DefaultExecHandle.java#L257

I could of course provide the connection string in an options file, but that would negate the flexibility of providing connection details via gradle properties.

So, main question: is there another way to specify the connection string, without it showing up in JavaExec logging?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions