Skip to content

Extend a set of options in WriteOption to allow defining the log location as custom project, folder, org or billing account #684

Closed
@minherz

Description

@minherz

Currently, the set of WriteOption options is limited to

enum OptionType implements Option.OptionType {
LOG_NAME,
RESOURCE,
LABELS;

and does not allow to customize log name. The location of the log is produced based on the project id which is taken from the logging client options:
String projectId = serviceOptions.getProjectId();
WriteLogEntriesRequest.Builder builder = WriteLogEntriesRequest.newBuilder();
String logName = LOG_NAME.get(options);
if (logName != null) {
builder.setLogName(LogName.ofProjectLogName(projectId, logName).toString());
}

This project id is retrieved from authentication workflow and is not necessary the same with the needed log destination. There also cases when the destination should be other than a project

Metadata

Metadata

Assignees

Labels

api: loggingIssues related to the googleapis/java-logging API.lang: javaIssues specific to Java.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions