Skip to content

Commit

Permalink
add more logs
Browse files Browse the repository at this point in the history
Signed-off-by: Tianle Huang <[email protected]>
  • Loading branch information
tianleh committed Mar 15, 2024
1 parent 333e76e commit b93cdb6
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/plugins/application_config/server/routes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ export async function handleGetEntityConfig(
response: OpenSearchDashboardsResponseFactory,
logger: Logger
) {
logger.info(`Received a request to get entity config for ${request.params.entity}.`);

try {
const result = await client.getEntityConfig(request.params.entity, {
headers: request.headers,
Expand All @@ -106,6 +108,10 @@ export async function handleUpdateEntityConfig(
response: OpenSearchDashboardsResponseFactory,
logger: Logger
) {
logger.info(
`Received a request to update entity ${request.params.entity} with new value ${request.body.newValue}.`
);

try {
const result = await client.updateEntityConfig(request.params.entity, request.body.newValue, {
headers: request.headers,
Expand All @@ -127,6 +133,8 @@ export async function handleDeleteEntityConfig(
response: OpenSearchDashboardsResponseFactory,
logger: Logger
) {
logger.info(`Received a request to delete entity ${request.params.entity}.`);

try {
const result = await client.deleteEntityConfig(request.params.entity, {
headers: request.headers,
Expand All @@ -148,6 +156,8 @@ export async function handleGetConfig(
response: OpenSearchDashboardsResponseFactory,
logger: Logger
) {
logger.info('Received a request to get all configurations.');

try {
const result = await client.getConfig({ headers: request.headers });
return response.ok({
Expand Down

0 comments on commit b93cdb6

Please sign in to comment.