mirror of
https://github.com/expo/turtle.git
synced 2026-11-14 19:12:55 -10:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
251b9841da |
No files matched your search
+3
-1
@@ -1,10 +1,12 @@
|
||||
!/src/node_modules
|
||||
|
||||
node_modules
|
||||
yarn-error.log
|
||||
|
||||
/build/
|
||||
/workingdir/*
|
||||
/artifacts/*
|
||||
shell.apk
|
||||
node_modules
|
||||
.secrets*
|
||||
|
||||
*.swp
|
||||
|
||||
@@ -2,7 +2,6 @@ LOGGER_LEVEL="debug"
|
||||
API_PROTOCOL="http"
|
||||
API_HOSTNAME="localhost"
|
||||
API_PORT="3000"
|
||||
LOGGLY_TOKEN=""
|
||||
SENTRY_DSN=""
|
||||
ENVIRONMENT="development"
|
||||
REDIS_URL="redis://localhost:6379/0"
|
||||
|
||||
@@ -50,8 +50,6 @@ spec:
|
||||
value: exp-shell-app-assets
|
||||
- name: AWS_S3_REGION
|
||||
value: us-west-1
|
||||
- name: LOGGLY_SUBDOMAIN
|
||||
value: exponent
|
||||
- name: TURTLE_TEMPORARY_FILES_DIR
|
||||
value: /tmp/turtle
|
||||
# vars from k8s secrets
|
||||
@@ -100,11 +98,6 @@ spec:
|
||||
secretKeyRef:
|
||||
name: turtle-js-config
|
||||
key: aws_cloudwatch_region
|
||||
- name: LOGGLY_TOKEN
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: turtle-js-config
|
||||
key: loggly_token
|
||||
- name: REDIS_URL
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
|
||||
@@ -105,7 +105,6 @@
|
||||
"aws-sdk": "^2.226.1",
|
||||
"bunyan": "^1.8.12",
|
||||
"bunyan-debug-stream": "^1.0.8",
|
||||
"bunyan-loggly": "^1.3.4",
|
||||
"bunyan-sentry-stream": "^1.2.1",
|
||||
"commander": "^2.15.1",
|
||||
"copy": "^0.3.1",
|
||||
|
||||
@@ -47,11 +47,6 @@ export default {
|
||||
client: {
|
||||
level: env('CLIENT_LOGGER_LEVEL', 'info'),
|
||||
},
|
||||
loggly: {
|
||||
token: env('LOGGLY_TOKEN', ''),
|
||||
subdomain: env('LOGGLY_SUBDOMAIN', ''),
|
||||
buffer: envNum('LOGGLY_BUFFER', 100),
|
||||
},
|
||||
},
|
||||
google: {
|
||||
credentials: env('GOOGLE_APPLICATION_CREDENTIALS', ''),
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
import EventEmitter from 'events';
|
||||
|
||||
import BunyanLoggly from 'bunyan-loggly';
|
||||
|
||||
import config from 'turtle/config';
|
||||
import * as constants from 'turtle/constants/logger';
|
||||
import { IJob } from 'turtle/job';
|
||||
|
||||
export interface ILogglyConfig {
|
||||
token: string;
|
||||
subdomain: string;
|
||||
tags: string[];
|
||||
}
|
||||
|
||||
interface ILogglyExtraFields {
|
||||
jobID: string;
|
||||
experienceName: string;
|
||||
}
|
||||
|
||||
export default class HackyLogglyStream extends EventEmitter {
|
||||
private logglyStream: BunyanLoggly;
|
||||
private extraFields: ILogglyExtraFields | null;
|
||||
|
||||
constructor(logglyConfig: ILogglyConfig) {
|
||||
super();
|
||||
this.logglyStream = new BunyanLoggly(logglyConfig, config.logger.loggly.buffer);
|
||||
this.extraFields = null;
|
||||
}
|
||||
public init(job: IJob) {
|
||||
this.extraFields = {
|
||||
jobID: job.id,
|
||||
experienceName: job.experienceName,
|
||||
};
|
||||
}
|
||||
public cleanup() {
|
||||
this.extraFields = null;
|
||||
}
|
||||
public write(rec: any) {
|
||||
const { msg: message, hostname: host, level, ...other } = rec;
|
||||
this.logglyStream.write({
|
||||
message,
|
||||
level: constants.LEVELS_MAPPING[level],
|
||||
host,
|
||||
...other,
|
||||
data: this.extraFields || {},
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,6 @@ import { Client as RavenClient } from 'raven';
|
||||
import config from 'turtle/config';
|
||||
import * as constants from 'turtle/constants/logger';
|
||||
import { IJob } from 'turtle/job';
|
||||
import HackyLogglyStream from 'turtle/logger/hackyLogglyStream';
|
||||
import S3Stream from 'turtle/logger/s3Stream';
|
||||
import { isOffline } from 'turtle/turtleContext';
|
||||
|
||||
@@ -23,7 +22,6 @@ interface IStream {
|
||||
}
|
||||
|
||||
export const s3logger = new S3Stream();
|
||||
let logglyStream: HackyLogglyStream;
|
||||
|
||||
const streams: IStream[] = [];
|
||||
|
||||
@@ -52,22 +50,6 @@ if (config.sentry.dsn && config.deploymentEnv !== 'development') {
|
||||
});
|
||||
}
|
||||
|
||||
if (config.logger.loggly.token) {
|
||||
const logglyConfig = {
|
||||
token: config.logger.loggly.token,
|
||||
subdomain: config.logger.loggly.subdomain,
|
||||
// prettier-ignore
|
||||
tags: [
|
||||
'app-shell-apps',
|
||||
],
|
||||
};
|
||||
logglyStream = new HackyLogglyStream(logglyConfig);
|
||||
streams.push({
|
||||
type: 'raw',
|
||||
stream: logglyStream,
|
||||
});
|
||||
}
|
||||
|
||||
if (config.google.credentials) {
|
||||
const resource = {
|
||||
type: 'generic_node',
|
||||
@@ -91,18 +73,12 @@ const logger = bunyan.createLogger({
|
||||
logger.withFields = (extraFields: any) => withFields(logger, extraFields);
|
||||
|
||||
logger.init = async (job: IJob) => {
|
||||
if (logglyStream) {
|
||||
logglyStream.init(job);
|
||||
}
|
||||
return await s3logger.init(job);
|
||||
};
|
||||
|
||||
logger.cleanup = async () => {
|
||||
// a little hacky, but works
|
||||
logger.info({ lastBuildLog: true }, 'this is the last log from this build');
|
||||
if (logglyStream) {
|
||||
logglyStream.cleanup();
|
||||
}
|
||||
await s3logger.waitForLogger();
|
||||
};
|
||||
|
||||
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
export = BunyanLoggly;
|
||||
|
||||
declare class BunyanLoggly {
|
||||
constructor(options: BunyanLoggly.IOptions, bufferLength?: number, bufferTimeout?: number, logglyCallback?: any);
|
||||
public write(data: any): void;
|
||||
}
|
||||
|
||||
declare namespace BunyanLoggly {
|
||||
interface IOptions {
|
||||
token: string;
|
||||
subdomain: string;
|
||||
}
|
||||
}
|
||||
@@ -2513,14 +2513,6 @@ bunyan-debug-stream@^1.0.8:
|
||||
colors "^1.0.3"
|
||||
exception-formatter "^1.0.4"
|
||||
|
||||
bunyan-loggly@^1.3.4:
|
||||
version "1.4.1"
|
||||
resolved "https://registry.yarnpkg.com/bunyan-loggly/-/bunyan-loggly-1.4.1.tgz#b6c806fb34bfcde2ce0d98878cf3534620b969e7"
|
||||
integrity sha512-D2NGeqz94bWWa8gTgEXLtSNGuKprpAhUroGv2gFJeJ1cwhGEkwQJBgshrNUfW/zMuaI5rKCmxMo0G47ob4BemQ==
|
||||
dependencies:
|
||||
json-stringify-safe "^5.0.1"
|
||||
node-loggly-bulk "^2.2.4"
|
||||
|
||||
bunyan-sentry-stream@^1.2.1:
|
||||
version "1.2.1"
|
||||
resolved "https://registry.yarnpkg.com/bunyan-sentry-stream/-/bunyan-sentry-stream-1.2.1.tgz#fdd9f42fa75879f2a210579bdc2712f8285cd12b"
|
||||
@@ -7463,7 +7455,7 @@ json-stable-stringify@^1.0.1:
|
||||
dependencies:
|
||||
jsonify "~0.0.0"
|
||||
|
||||
[email protected], json-stringify-safe@^5.0.1, json-stringify-safe@~5.0.1:
|
||||
json-stringify-safe@^5.0.1, json-stringify-safe@~5.0.1:
|
||||
version "5.0.1"
|
||||
resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb"
|
||||
integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=
|
||||
@@ -8450,11 +8442,6 @@ moment@^2.10.6:
|
||||
resolved "https://registry.yarnpkg.com/moment/-/moment-2.22.2.tgz#3c257f9839fc0e93ff53149632239eb90783ff66"
|
||||
integrity sha1-PCV/mDn8DpP/UxSWMiOeuQeD/2Y=
|
||||
|
||||
moment@^2.18.1:
|
||||
version "2.24.0"
|
||||
resolved "https://registry.yarnpkg.com/moment/-/moment-2.24.0.tgz#0d055d53f5052aa653c9f6eb68bb5d12bf5c2b5b"
|
||||
integrity sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg==
|
||||
|
||||
move-concurrently@^1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/move-concurrently/-/move-concurrently-1.0.1.tgz#be2c005fda32e0b29af1f05d7c4b33214c701f92"
|
||||
@@ -8681,15 +8668,6 @@ node-libs-browser@^2.0.0:
|
||||
util "^0.11.0"
|
||||
vm-browserify "0.0.4"
|
||||
|
||||
node-loggly-bulk@^2.2.4:
|
||||
version "2.2.4"
|
||||
resolved "https://registry.yarnpkg.com/node-loggly-bulk/-/node-loggly-bulk-2.2.4.tgz#bdd8638d97c43ecf1e1831ca98b250968fa6dee9"
|
||||
integrity sha512-DfhtsDfkSBU6Dp1zvK+H1MgHRcA2yb4z07ctyA6uo+bNwKtv1exhohN910zcWNkdSYq1TImCq+O+3bOTuYHvmQ==
|
||||
dependencies:
|
||||
json-stringify-safe "5.0.x"
|
||||
moment "^2.18.1"
|
||||
request ">=2.76.0 <3.0.0"
|
||||
|
||||
node-notifier@^5.2.1:
|
||||
version "5.4.0"
|
||||
resolved "https://registry.yarnpkg.com/node-notifier/-/node-notifier-5.4.0.tgz#7b455fdce9f7de0c63538297354f3db468426e6a"
|
||||
@@ -10443,7 +10421,7 @@ request-promise-native@^1.0.5:
|
||||
stealthy-require "^1.1.1"
|
||||
tough-cookie "^2.3.3"
|
||||
|
||||
[email protected], "request@>=2.76.0 <3.0.0", request@^2.81.0, request@^2.83.0, request@^2.87.0, request@^2.88.0:
|
||||
[email protected], request@^2.81.0, request@^2.83.0, request@^2.87.0, request@^2.88.0:
|
||||
version "2.88.0"
|
||||
resolved "https://registry.yarnpkg.com/request/-/request-2.88.0.tgz#9c2fca4f7d35b592efe57c7f0a55e81052124fef"
|
||||
integrity sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==
|
||||
|
||||
Reference in new issue
Block a user