Renamings
This commit is contained in:
parent
8c8317253a
commit
0b5717cde5
|
@ -30,7 +30,7 @@ import { buildBackupsEndpoints } from "./backups"
|
||||||
import { buildEnvironmentVariableEndpoints } from "./environmentVariables"
|
import { buildEnvironmentVariableEndpoints } from "./environmentVariables"
|
||||||
import { buildEventEndpoints } from "./events"
|
import { buildEventEndpoints } from "./events"
|
||||||
import { buildAuditLogsEndpoints } from "./auditLogs"
|
import { buildAuditLogsEndpoints } from "./auditLogs"
|
||||||
import { buildSystemLogsEndpoints } from "./systemLogs"
|
import { buildLogsEndpoints } from "./logs"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Random identifier to uniquely identify a session in a tab. This is
|
* Random identifier to uniquely identify a session in a tab. This is
|
||||||
|
@ -278,6 +278,6 @@ export const createAPIClient = config => {
|
||||||
...buildEnvironmentVariableEndpoints(API),
|
...buildEnvironmentVariableEndpoints(API),
|
||||||
...buildEventEndpoints(API),
|
...buildEventEndpoints(API),
|
||||||
...buildAuditLogsEndpoints(API),
|
...buildAuditLogsEndpoints(API),
|
||||||
...buildSystemLogsEndpoints(API),
|
...buildLogsEndpoints(API),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
export const buildSystemLogsEndpoints = API => ({
|
export const buildLogsEndpoints = API => ({
|
||||||
/**
|
/**
|
||||||
* Gets a stream for the system logs.
|
* Gets a stream for the system logs.
|
||||||
*/
|
*/
|
||||||
getSystemLogs: async () => {
|
getSystemLogs: async () => {
|
||||||
return await API.get({
|
return await API.get({
|
||||||
url: "/api/global/system/logs",
|
url: "/api/system/logs",
|
||||||
json: false,
|
json: false,
|
||||||
parseResponse: async response => {
|
parseResponse: async response => {
|
||||||
return response
|
return response
|
|
@ -1,10 +1,12 @@
|
||||||
import { UserCtx } from "@budibase/types"
|
import { UserCtx } from "@budibase/types"
|
||||||
import { context, logging } from "@budibase/backend-core"
|
import { installation, logging } from "@budibase/backend-core"
|
||||||
|
|
||||||
export async function getLogs(ctx: UserCtx) {
|
export async function getLogs(ctx: UserCtx) {
|
||||||
const logReadStream = logging.system.getLogReadStream()
|
const logReadStream = logging.system.getLogReadStream()
|
||||||
|
|
||||||
const fileName = `${context.getTenantId()}-${Date.now()}.logs`
|
const { installId } = await installation.getInstall()
|
||||||
|
|
||||||
|
const fileName = `${installId}-${Date.now()}.logs`
|
||||||
|
|
||||||
ctx.set("content-disposition", `attachment; filename=${fileName}`)
|
ctx.set("content-disposition", `attachment; filename=${fileName}`)
|
||||||
ctx.body = logReadStream
|
ctx.body = logReadStream
|
||||||
|
|
|
@ -4,6 +4,6 @@ import * as controller from "../../controllers/system/logs"
|
||||||
|
|
||||||
const router: Router = new Router()
|
const router: Router = new Router()
|
||||||
|
|
||||||
router.get("/api/global/system/logs", middleware.adminOnly, controller.getLogs)
|
router.get("/api/system/logs", middleware.adminOnly, controller.getLogs)
|
||||||
|
|
||||||
export default router
|
export default router
|
||||||
|
|
Loading…
Reference in New Issue