Rwatana / BlogService

0 stars 0 forks source link

[Log]imprement parts to send Log to DB by using Go server. #5

Closed Rwatana closed 4 months ago

Rwatana commented 5 months ago

Topic

I have prepared two main components for logging. In this Pull Request (PR), I completed the function for sending logs to the Go server and the process for transmitting these logs from the Go server to the database (DB).

I established a baseline for this, and in the next PR, I will integrate the function into various parts of my code.

Modify Points

Test

I executed sendDemo.js located at:

loggingServer/sendServer/sendDemo.js

I received the following results on the Go server:

loggingServer/server.go

2024/06/09 18:03:25 Messages cleared successfully.
2024/06/09 18:04:08 Received Message: {LogLevel:INFO Date:2024-06-09 12:00:00 +0000 UTC CurrentService:Service A SourceService:Service B TypeOfRequest:POST Content:Test log message}

I also ran the code sendLogtoDB.go located at:

loggingDB/sendLogtoDB.go

Upon success, I received:

2024/06/09 18:05:53 Received result: map[message:All logs inserted successfully. status:success]
2024/06/09 18:05:53 Messages cleared successfully.

Upon failure, I received:

2024/06/09 19:02:01 Received result: map[message:Failed to insert some logs into the database. status:error]
2024/06/09 19:02:01 Failed to insert log into database, status: error

In the DB section, the logs were recorded as follows:

| EMERGE    | 2024-06-09 09:11:01 | event-bus       | comments       | POST            | demo             |
| EMERGE    | 2024-06-09 09:11:01 | event-bus       | comments       | POST            | demo             |
| EMERGE    | 2024-06-09 09:54:21 | event-bus       | comments       | POST            | demo             |
+-----------+---------------------+-----------------+----------------+-----------------+------------------+

Question

I think my PR includes too many changes, and I should have separated it into smaller PRs. However, I'm not sure how to do this effectively. For the future, I would like guidance on how to properly structure and split PRs to ensure they are manageable.

Rwatana commented 5 months ago

@ryuji0123 I believe I have implemented the code according to your instructions. Could you please review my changes?

Rwatana commented 4 months ago

Sure, I will prepare a sequential graph for our understanding. Regarding my schedule, I am participating in a 2-day Infrastructure internship hosted by CyberAgent this weekend. Therefore, the earliest I can meet is the following weekend. Thank you for your understanding.