Skip to content
This repository was archived by the owner on Jan 16, 2025. It is now read-only.

Commit a250b96

Browse files
authored
feat: add option to format logging in JSON for lambdas (#1228)
* feat(log): Adding Support for JSON logging * Passing in log_type to other lambdas * Casting e as Error * Add log_level variable, fix formatting * Correcting failed resolution * Using latest releases for testing * Passing in log_level to sub-modules * Update terraform.yml * Manually removing `node-fetch` * Moving logger object to new file * Resolving merge from develop Wouldn't be a conflict resolve without a miss * Logging when job is not queued * Updating handler names
1 parent 04c102c commit a250b96

40 files changed

+532
-228
lines changed

.github/workflows/terraform.yml

+3-6
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,11 @@ env:
1313
tf_working_dir: "."
1414
AWS_REGION: eu-west-1
1515
jobs:
16-
1716
verify_module:
1817
name: Verify module
1918
strategy:
2019
matrix:
21-
terraform: [1.0.8]
20+
terraform: [1.0.8]
2221
runs-on: ubuntu-latest
2322
container:
2423
image: hashicorp/terraform:${{ matrix.terraform }}
@@ -43,15 +42,15 @@ jobs:
4342
strategy:
4443
fail-fast: false
4544
matrix:
46-
terraform: [0.14.1, 0.15.0, 1.0.8]
45+
terraform: [0.14.3, 0.15.5, 1.0.8]
4746
example: ["default", "ubuntu"]
4847
defaults:
4948
run:
5049
working-directory: examples/${{ matrix.example }}
5150
runs-on: ubuntu-latest
5251
container:
5352
image: hashicorp/terraform:${{ matrix.terraform }}
54-
steps:
53+
steps:
5554
- uses: actions/checkout@v2
5655
- name: terraform init
5756
run: terraform init -get -backend=false -input=false
@@ -61,5 +60,3 @@ jobs:
6160
continue-on-error: true
6261
- name: validate terraform
6362
run: terraform validate
64-
65-

README.md

+82-78
Large diffs are not rendered by default.

main.tf

+9
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ module "webhook" {
6464
role_path = var.role_path
6565
role_permissions_boundary = var.role_permissions_boundary
6666
repository_white_list = var.repository_white_list
67+
68+
log_type = var.log_type
69+
log_level = var.log_level
6770
}
6871

6972
module "runners" {
@@ -133,6 +136,9 @@ module "runners" {
133136
ghes_ssl_verify = var.ghes_ssl_verify
134137

135138
kms_key_arn = var.kms_key_arn
139+
140+
log_type = var.log_type
141+
log_level = var.log_level
136142
}
137143

138144
module "runner_binaries" {
@@ -156,6 +162,9 @@ module "runner_binaries" {
156162

157163
role_path = var.role_path
158164
role_permissions_boundary = var.role_permissions_boundary
165+
166+
log_type = var.log_type
167+
log_level = var.log_level
159168
}
160169

161170
resource "aws_resourcegroups_group" "resourcegroups_group" {

modules/runner-binaries-syncer/README.md

+19-17
Original file line numberDiff line numberDiff line change
@@ -75,23 +75,25 @@ No modules.
7575

7676
| Name | Description | Type | Default | Required |
7777
|------|-------------|------|---------|:--------:|
78-
| <a name="input_aws_region"></a> [aws\_region](#input\_aws\_region) | AWS region. | `string` | n/a | yes |
79-
| <a name="input_distribution_bucket_name"></a> [distribution\_bucket\_name](#input\_distribution\_bucket\_name) | Bucket for storing the action runner distribution. | `string` | n/a | yes |
80-
| <a name="input_environment"></a> [environment](#input\_environment) | A name that identifies the environment, used as prefix and for tagging. | `string` | n/a | yes |
81-
| <a name="input_lambda_s3_bucket"></a> [lambda\_s3\_bucket](#input\_lambda\_s3\_bucket) | S3 bucket from which to specify lambda functions. This is an alternative to providing local files directly. | `any` | `null` | no |
82-
| <a name="input_lambda_schedule_expression"></a> [lambda\_schedule\_expression](#input\_lambda\_schedule\_expression) | Scheduler expression for action runner binary syncer. | `string` | `"cron(27 * * * ? *)"` | no |
83-
| <a name="input_lambda_security_group_ids"></a> [lambda\_security\_group\_ids](#input\_lambda\_security\_group\_ids) | List of security group IDs associated with the Lambda function. | `list(string)` | `[]` | no |
84-
| <a name="input_lambda_subnet_ids"></a> [lambda\_subnet\_ids](#input\_lambda\_subnet\_ids) | List of subnets in which the action runners will be launched, the subnets needs to be subnets in the `vpc_id`. | `list(string)` | `[]` | no |
85-
| <a name="input_lambda_timeout"></a> [lambda\_timeout](#input\_lambda\_timeout) | Time out of the lambda in seconds. | `number` | `300` | no |
86-
| <a name="input_lambda_zip"></a> [lambda\_zip](#input\_lambda\_zip) | File location of the lambda zip file. | `string` | `null` | no |
87-
| <a name="input_logging_retention_in_days"></a> [logging\_retention\_in\_days](#input\_logging\_retention\_in\_days) | Specifies the number of days you want to retain log events for the lambda log group. Possible values are: 0, 1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180, 365, 400, 545, 731, 1827, and 3653. | `number` | `7` | no |
88-
| <a name="input_role_path"></a> [role\_path](#input\_role\_path) | The path that will be added to the role, if not set the environment name will be used. | `string` | `null` | no |
89-
| <a name="input_role_permissions_boundary"></a> [role\_permissions\_boundary](#input\_role\_permissions\_boundary) | Permissions boundary that will be added to the created role for the lambda. | `string` | `null` | no |
90-
| <a name="input_runner_allow_prerelease_binaries"></a> [runner\_allow\_prerelease\_binaries](#input\_runner\_allow\_prerelease\_binaries) | Allow the runners to update to prerelease binaries. | `bool` | `false` | no |
91-
| <a name="input_runner_architecture"></a> [runner\_architecture](#input\_runner\_architecture) | The platform architecture for the runner instance (x64, arm64), defaults to 'x64' | `string` | `"x64"` | no |
92-
| <a name="input_syncer_lambda_s3_key"></a> [syncer\_lambda\_s3\_key](#input\_syncer\_lambda\_s3\_key) | S3 key for syncer lambda function. Required if using S3 bucket to specify lambdas. | `any` | `null` | no |
93-
| <a name="input_syncer_lambda_s3_object_version"></a> [syncer\_lambda\_s3\_object\_version](#input\_syncer\_lambda\_s3\_object\_version) | S3 object version for syncer lambda function. Useful if S3 versioning is enabled on source bucket. | `any` | `null` | no |
94-
| <a name="input_tags"></a> [tags](#input\_tags) | Map of tags that will be added to created resources. By default resources will be tagged with name and environment. | `map(string)` | `{}` | no |
78+
| aws\_region | AWS region. | `string` | n/a | yes |
79+
| distribution\_bucket\_name | Bucket for storing the action runner distribution. | `string` | n/a | yes |
80+
| environment | A name that identifies the environment, used as prefix and for tagging. | `string` | n/a | yes |
81+
| lambda\_s3\_bucket | S3 bucket from which to specify lambda functions. This is an alternative to providing local files directly. | `any` | `null` | no |
82+
| lambda\_schedule\_expression | Scheduler expression for action runner binary syncer. | `string` | `"cron(27 * * * ? *)"` | no |
83+
| lambda\_security\_group\_ids | List of security group IDs associated with the Lambda function. | `list(string)` | `[]` | no |
84+
| lambda\_subnet\_ids | List of subnets in which the action runners will be launched, the subnets needs to be subnets in the `vpc_id`. | `list(string)` | `[]` | no |
85+
| lambda\_timeout | Time out of the lambda in seconds. | `number` | `300` | no |
86+
| lambda\_zip | File location of the lambda zip file. | `string` | `null` | no |
87+
| log\_level | Logging level for lambda logging. Valid values are 'silly', 'trace', 'debug', 'info', 'warn', 'error', 'fatal'. | `string` | `"info"` | no |
88+
| log\_type | Logging format for lambda logging. Valid values are 'json', 'pretty', 'hidden'. | `string` | `"pretty"` | no |
89+
| logging\_retention\_in\_days | Specifies the number of days you want to retain log events for the lambda log group. Possible values are: 0, 1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180, 365, 400, 545, 731, 1827, and 3653. | `number` | `7` | no |
90+
| role\_path | The path that will be added to the role, if not set the environment name will be used. | `string` | `null` | no |
91+
| role\_permissions\_boundary | Permissions boundary that will be added to the created role for the lambda. | `string` | `null` | no |
92+
| runner\_allow\_prerelease\_binaries | Allow the runners to update to prerelease binaries. | `bool` | `false` | no |
93+
| runner\_architecture | The platform architecture for the runner instance (x64, arm64), defaults to 'x64' | `string` | `"x64"` | no |
94+
| syncer\_lambda\_s3\_key | S3 key for syncer lambda function. Required if using S3 bucket to specify lambdas. | `any` | `null` | no |
95+
| syncer\_lambda\_s3\_object\_version | S3 object version for syncer lambda function. Useful if S3 versioning is enabled on source bucket. | `any` | `null` | no |
96+
| tags | Map of tags that will be added to created resources. By default resources will be tagged with name and environment. | `map(string)` | `{}` | no |
9597

9698
## Outputs
9799

modules/runner-binaries-syncer/lambdas/runner-binaries-syncer/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
"typescript": "^4.4.4"
3333
},
3434
"dependencies": {
35+
"tslog": "^3.2.2",
3536
"axios": "^0.24.0"
3637
}
37-
}
38+
}

modules/runner-binaries-syncer/lambdas/runner-binaries-syncer/src/lambda.ts

+3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
import { handle } from './syncer/handler';
2+
import { logger } from './syncer/logger';
23

34
// eslint-disable-next-line
45
export const handler = async (event: any, context: any, callback: any): Promise<void> => {
6+
logger.setSettings({ requestId: context.awsRequestId });
7+
logger.debug(JSON.stringify(event));
58
try {
69
await handle();
710
callback(null);

modules/runner-binaries-syncer/lambdas/runner-binaries-syncer/src/syncer/handler.ts

+9-6
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ import { PassThrough } from 'stream';
33
import { S3 } from 'aws-sdk';
44
import AWS from 'aws-sdk';
55
import axios from 'axios';
6+
import { logger as rootLogger } from './logger';
7+
8+
const logger = rootLogger.getChildLogger();
69

710
const versionKey = 'name';
811

@@ -22,7 +25,7 @@ async function getCachedVersion(s3: S3, cacheObject: CacheObject): Promise<strin
2225
const versions = objectTagging.TagSet?.filter((t: S3.Tag) => t.Key === versionKey);
2326
return versions.length === 1 ? versions[0].Value : undefined;
2427
} catch (e) {
25-
console.debug('No tags found');
28+
logger.debug('No tags found');
2629
return undefined;
2730
}
2831
}
@@ -73,7 +76,7 @@ async function uploadToS3(s3: S3, cacheObject: CacheObject, actionRunnerReleaseA
7376
})
7477
.promise();
7578

76-
console.debug('Start downloading %s and uploading to S3.', actionRunnerReleaseAsset.name);
79+
logger.debug('Start downloading %s and uploading to S3.', actionRunnerReleaseAsset.name);
7780

7881
const readPromise = new Promise<void>((resolve, reject) => {
7982
axios
@@ -93,9 +96,9 @@ async function uploadToS3(s3: S3, cacheObject: CacheObject, actionRunnerReleaseA
9396
});
9497

9598
await Promise.all([readPromise, writePromise])
96-
.then(() => console.info(`The new distribution is uploaded to S3.`))
99+
.then(() => logger.info(`The new distribution is uploaded to S3.`))
97100
.catch((error) => {
98-
console.error(`Uploading of the new distribution to S3 failed: ${error}`);
101+
logger.error(`Uploading of the new distribution to S3 failed: ${error}`);
99102
throw error;
100103
});
101104
}
@@ -120,10 +123,10 @@ export const handle = async (): Promise<void> => {
120123
}
121124

122125
const currentVersion = await getCachedVersion(s3, cacheObject);
123-
console.debug('latest: ' + currentVersion);
126+
logger.debug('latest: ' + currentVersion);
124127
if (currentVersion === undefined || currentVersion != actionRunnerReleaseAsset.name) {
125128
uploadToS3(s3, cacheObject, actionRunnerReleaseAsset);
126129
} else {
127-
console.debug('Distribution is up-to-date, no action.');
130+
logger.debug('Distribution is up-to-date, no action.');
128131
}
129132
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { Logger } from 'tslog';
2+
3+
export const logger = new Logger({
4+
colorizePrettyLogs: false,
5+
displayInstanceName: false,
6+
minLevel: process.env.LOG_LEVEL || 'info',
7+
name: 'runner-binaries-syncer',
8+
overwriteConsole: true,
9+
type: process.env.LOG_TYPE || 'pretty',
10+
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
declare namespace NodeJS {
2+
export interface ProcessEnv {
3+
LOG_LEVEL: 'silly' | 'trace' | 'debug' | 'info' | 'warn' | 'error' | 'fatal';
4+
LOG_TYPE: 'json' | 'pretty' | 'hidden';
5+
}
6+
}

modules/runner-binaries-syncer/lambdas/runner-binaries-syncer/tsconfig.json

+10-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
{
22
"compilerOptions": {
33
/* Basic Options */
4-
"target": "es6" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */,
4+
"target": "es2019" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */,
55
"module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */,
66
"outDir": "build",
7-
"lib": ["es2020", "DOM"] /* Specify library files to be included in the compilation. */,
7+
"lib": [
8+
"es2020",
9+
"DOM"
10+
] /* Specify library files to be included in the compilation. */,
811
"allowJs": true /* Allow javascript files to be compiled. */,
912
// "checkJs": true, /* Report errors in .js files. */
1013
// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
@@ -54,7 +57,10 @@
5457
/* Experimental Options */
5558
"experimentalDecorators": true /* Enables experimental support for ES7 decorators. */,
5659
"emitDecoratorMetadata": true /* Enables experimental support for emitting type metadata for decorators. */,
57-
"resolveJsonModule": true
60+
"resolveJsonModule": true,
61+
"sourceMap": true
5862
},
59-
"include": ["src/**/*"]
63+
"include": [
64+
"src/**/*"
65+
]
6066
}

modules/runner-binaries-syncer/lambdas/runner-binaries-syncer/yarn.lock

+9-2
Original file line numberDiff line numberDiff line change
@@ -3148,10 +3148,10 @@ source-map-support@^0.5.12, source-map-support@^0.5.17:
31483148
buffer-from "^1.0.0"
31493149
source-map "^0.6.0"
31503150

3151-
source-map-support@^0.5.6:
3151+
source-map-support@^0.5.19, source-map-support@^0.5.6:
31523152
version "0.5.20"
31533153
resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.20.tgz#12166089f8f5e5e8c56926b377633392dd2cb6c9"
3154-
integrity sha512-n1lZZ8Ve4ksRqizaBQgxXDgKwttHDhyfQjA6YZZn8+AroHbsIz+JjwxQDxbp+7y5OYCI8t1Yk7etjD9CRd2hIw==
3154+
integrity sha1-EhZgifj15ejFaSazd2Mzkt0stsk=
31553155
dependencies:
31563156
buffer-from "^1.0.0"
31573157
source-map "^0.6.0"
@@ -3421,6 +3421,13 @@ tslib@^1.8.1:
34213421
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00"
34223422
integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==
34233423

3424+
tslog@^3.2.2:
3425+
version "3.2.2"
3426+
resolved "https://registry.yarnpkg.com/tslog/-/tslog-3.2.2.tgz#5bbaa1fab685c4273e59b38064227321a69a0694"
3427+
integrity sha1-W7qh+raFxCc+WbOAZCJzIaaaBpQ=
3428+
dependencies:
3429+
source-map-support "^0.5.19"
3430+
34243431
tsutils@^3.21.0:
34253432
version "3.21.0"
34263433
resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.21.0.tgz#b48717d394cea6c1e096983eed58e9d61715b623"

modules/runner-binaries-syncer/runner-binaries-syncer.tf

+4-2
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,12 @@ resource "aws_lambda_function" "syncer" {
1818

1919
environment {
2020
variables = {
21-
S3_BUCKET_NAME = aws_s3_bucket.action_dist.id
22-
S3_OBJECT_KEY = local.action_runner_distribution_object_key
2321
GITHUB_RUNNER_ARCHITECTURE = var.runner_architecture
2422
GITHUB_RUNNER_ALLOW_PRERELEASE_BINARIES = var.runner_allow_prerelease_binaries
23+
LOG_LEVEL = var.log_level
24+
LOG_TYPE = var.log_type
25+
S3_BUCKET_NAME = aws_s3_bucket.action_dist.id
26+
S3_OBJECT_KEY = local.action_runner_distribution_object_key
2527
}
2628
}
2729
dynamic "vpc_config" {

modules/runner-binaries-syncer/variables.tf

+32
Original file line numberDiff line numberDiff line change
@@ -98,3 +98,35 @@ variable "lambda_security_group_ids" {
9898
type = list(string)
9999
default = []
100100
}
101+
102+
variable "log_type" {
103+
description = "Logging format for lambda logging. Valid values are 'json', 'pretty', 'hidden'. "
104+
type = string
105+
default = "pretty"
106+
validation {
107+
condition = anytrue([
108+
var.log_type == "json",
109+
var.log_type == "pretty",
110+
var.log_type == "hidden",
111+
])
112+
error_message = "`log_type` value not valid. Valid values are 'json', 'pretty', 'hidden'."
113+
}
114+
}
115+
116+
variable "log_level" {
117+
description = "Logging level for lambda logging. Valid values are 'silly', 'trace', 'debug', 'info', 'warn', 'error', 'fatal'."
118+
type = string
119+
default = "info"
120+
validation {
121+
condition = anytrue([
122+
var.log_level == "silly",
123+
var.log_level == "trace",
124+
var.log_level == "debug",
125+
var.log_level == "info",
126+
var.log_level == "warn",
127+
var.log_level == "error",
128+
var.log_level == "fatal",
129+
])
130+
error_message = "`log_level` value not valid. Valid values are 'silly', 'trace', 'debug', 'info', 'warn', 'error', 'fatal'."
131+
}
132+
}

modules/runners/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,8 @@ No modules.
132132
| <a name="input_lambda_timeout_scale_down"></a> [lambda\_timeout\_scale\_down](#input\_lambda\_timeout\_scale\_down) | Time out for the scale down lambda in seconds. | `number` | `60` | no |
133133
| <a name="input_lambda_timeout_scale_up"></a> [lambda\_timeout\_scale\_up](#input\_lambda\_timeout\_scale\_up) | Time out for the scale up lambda in seconds. | `number` | `60` | no |
134134
| <a name="input_lambda_zip"></a> [lambda\_zip](#input\_lambda\_zip) | File location of the lambda zip file. | `string` | `null` | no |
135+
| <a name="input_log_level"></a> [log\_level](#input\_log\_level) | Logging level for lambda logging. Valid values are 'silly', 'trace', 'debug', 'info', 'warn', 'error', 'fatal'. | `string` | `"info"` | no |
136+
| <a name="input_log_type"></a> [log\_type](#input\_log\_type) | Logging format for lambda logging. Valid values are 'json', 'pretty', 'hidden'. | `string` | `"pretty"` | no |
135137
| <a name="input_logging_retention_in_days"></a> [logging\_retention\_in\_days](#input\_logging\_retention\_in\_days) | Specifies the number of days you want to retain log events for the lambda log group. Possible values are: 0, 1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180, 365, 400, 545, 731, 1827, and 3653. | `number` | `180` | no |
136138
| <a name="input_market_options"></a> [market\_options](#input\_market\_options) | Market options for the action runner instances. | `string` | `"spot"` | no |
137139
| <a name="input_minimum_running_time_in_minutes"></a> [minimum\_running\_time\_in\_minutes](#input\_minimum\_running\_time\_in\_minutes) | The time an ec2 action runner should be running at minimum before terminated if non busy. | `number` | `5` | no |

modules/runners/lambdas/runners/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
"@types/node": "^16.11.6",
4444
"aws-sdk": "^2.1019.0",
4545
"cron-parser": "^4.1.0",
46+
"tslog": "^3.2.2",
4647
"typescript": "^4.4.4"
4748
}
4849
}
+16-12
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,31 @@
1-
import { scaleUp as scaleUpAction } from './scale-runners/scale-up';
2-
import { scaleDown as scaleDownAction } from './scale-runners/scale-down';
3-
import { SQSEvent, ScheduledEvent, Context } from 'aws-lambda';
1+
import { scaleUp } from './scale-runners/scale-up';
2+
import { scaleDown } from './scale-runners/scale-down';
3+
import { SQSEvent, ScheduledEvent, Context, Callback } from 'aws-lambda';
4+
import { logger } from './scale-runners/logger';
5+
import 'source-map-support/register';
46

5-
export const scaleUp = async (event: SQSEvent, context: Context, callback: any): Promise<void> => {
6-
console.debug(JSON.stringify(event));
7+
export async function scaleUpHandler(event: SQSEvent, context: Context, callback: Callback): Promise<void> {
8+
logger.setSettings({ requestId: context.awsRequestId });
9+
logger.debug(JSON.stringify(event));
710
try {
811
for (const e of event.Records) {
9-
await scaleUpAction(e.eventSource, JSON.parse(e.body));
12+
await scaleUp(e.eventSource, JSON.parse(e.body));
1013
}
1114

1215
callback(null);
1316
} catch (e) {
14-
console.error(e);
17+
logger.error(e);
1518
callback('Failed handling SQS event');
1619
}
17-
};
20+
}
1821

19-
export const scaleDown = async (event: ScheduledEvent, context: Context, callback: any): Promise<void> => {
22+
export async function scaleDownHandler(event: ScheduledEvent, context: Context, callback: Callback): Promise<void> {
23+
logger.setSettings({ requestId: context.awsRequestId });
2024
try {
21-
await scaleDownAction();
25+
await scaleDown();
2226
callback(null);
2327
} catch (e) {
24-
console.error(e);
28+
logger.error(e);
2529
callback('Failed');
2630
}
27-
};
31+
}

modules/runners/lambdas/runners/src/scale-runners/gh-auth.ts

+4
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ import {
1111
} from '@octokit/auth-app/dist-types/types';
1212
import { OctokitOptions } from '@octokit/core/dist-types/types';
1313
import { getParameterValue } from './ssm';
14+
import { logger as rootLogger } from './logger';
15+
16+
const logger = rootLogger.getChildLogger();
1417

1518
export async function createOctoClient(token: string, ghesApiUrl = ''): Promise<Octokit> {
1619
const ocktokitOptions: OctokitOptions = {
@@ -52,6 +55,7 @@ async function createAuth(installationId: number | undefined, ghesApiUrl: string
5255
};
5356
if (installationId) authOptions = { ...authOptions, installationId };
5457

58+
logger.debug(`GHES API URL: ${ghesApiUrl}`);
5559
if (ghesApiUrl) {
5660
authOptions.request = request.defaults({
5761
baseUrl: ghesApiUrl,

0 commit comments

Comments
 (0)