Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Logger does not work from the /appsmith-plugins directory #36073

Closed
1 task done
NilanshBansal opened this issue Sep 3, 2024 · 9 comments · Fixed by #36231
Closed
1 task done

[Bug]: Logger does not work from the /appsmith-plugins directory #36073

NilanshBansal opened this issue Sep 3, 2024 · 9 comments · Fixed by #36231
Assignees
Labels
Backend This marks the issue or pull request to reference server code Bug Something isn't working Good First Issue Good for newcomers Integrations Pod General Issues related to the Integrations Pod that don't fit into other tags. Integrations Pod Integrations Product Issues related to a specific integration Inviting Contribution Issues that we would like contributions to Low An issue that is neither critical nor breaks a user flow Needs Triaging Needs attention from maintainers to triage Production Query & JS Pod Issues related to the query & JS Pod Tech Debt Issues or Tasks which are tech debts

Comments

@NilanshBansal
Copy link
Contributor

NilanshBansal commented Sep 3, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Description

On adding log.debug(), log.info() in PostgresPlugin.java (and any other file in the /appsmith-plugins directory), these log statements are not printed to the console.


Attempted to Fix

#35568 (comment)

Steps To Reproduce

Configure the server locally and check for logs in the terminal after configuring postgres datasource.

Public Sample App

No response

Environment

Production

Severity

Low (Cosmetic UI issues)

Issue video log

No response

Version

Appsmith 2d8892f3

@NilanshBansal NilanshBansal added Bug Something isn't working Good First Issue Good for newcomers Backend This marks the issue or pull request to reference server code Needs Triaging Needs attention from maintainers to triage Inviting Contribution Issues that we would like contributions to labels Sep 3, 2024
@Nikhil-Nandagopal Nikhil-Nandagopal added Low An issue that is neither critical nor breaks a user flow Production labels Sep 3, 2024
@vuongdovu
Copy link

Hey @NilanshBansal could you assign me this issue? It's my first time doing an open source contribution, and i feel like this would be a good first issue.

@NilanshBansal
Copy link
Contributor Author

@vuongdovu please go ahead. Once you have raised the PR, please tag @appsmithorg/query-js-pod for review

@vuongdovu
Copy link

@NilanshBansal what is the best place to ask others questions in regards to fixing this bug? Is it the discord?

@NilanshBansal
Copy link
Contributor Author

NilanshBansal commented Sep 5, 2024

@vuongdovu you can raise your queries in the comments on this github issue.
It will also help others looking at the issue to know more about it.

@VanshRuhela
Copy link

Hey @NilanshBansal can I also work on this issue? It's my first time doing an open source contribution, and i feel like this would be a good first issue.

@NilanshBansal
Copy link
Contributor Author

Yes @VanshRuhela please go ahead

@NilanshBansal
Copy link
Contributor Author

@AnnaHariprasad5123 will you be interested in picking up this issue?

@AnnaHariprasad5123
Copy link
Contributor

Hi @NilanshBansal, I will work on this

@AnnaHariprasad5123
Copy link
Contributor

Hi @NilanshBansal, Could you review the pr.

@NilanshBansal NilanshBansal added Query & JS Pod Issues related to the query & JS Pod Integrations Pod General Issues related to the Integrations Pod that don't fit into other tags. Integrations Pod labels Sep 11, 2024
@github-actions github-actions bot added the Integrations Product Issues related to a specific integration label Sep 11, 2024
@NilanshBansal NilanshBansal added the Tech Debt Issues or Tasks which are tech debts label Sep 11, 2024
NilanshBansal added a commit that referenced this issue Sep 17, 2024
…f github.com:AnnaHariprasad5123/appsmith into chore/issue-36073/shadow-36231
@nerbos nerbos closed this as completed in 7aae152 Sep 17, 2024
Shivam-z pushed a commit to Shivam-z/appsmith that referenced this issue Sep 26, 2024
Fixes appsmithorg#36073 

Hi @NilanshBansal 

**Issue :**

**Missing Logging Implementation :**

- Without a logging implementation (such as SLF4J Simple or Logback) in
the project's classpath, the logging statements in the plugins cannot be
executed.
- As a result, no log output is being printed to the terminal.

**Solution :**

The solution is to add a logging implementation to the plugins parent
pom. In this case, you can add the slf4j-simple dependency to your
pom.xml file. This will provide a simple logging implementation that
will output log statements to the console.

```
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.36</version>
</dependency>

<dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-simple</artifactId>
    <version>1.7.36</version> 
</dependency>
```
**Explanation:**

- slf4j-api provides the SLF4J API, which is the interface for logging.
  provides the SLF4J API, which is the interface for logging.
- slf4j-simple provides a simple implementation of the SLF4J API, which
is responsible for actually printing the log messages to the console.

**Screenshots :** 

Amazon S3 Plugin and Postgres Plugin 

![image](https://github.com/user-attachments/assets/d3e90b96-2b02-493d-8ffa-44e2aa348fc1)


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

## Summary by CodeRabbit

- **New Features**
- Enhanced logging capabilities with the integration of SLF4J API and
SLF4J Simple implementations.

- **Improvements**
- Improved log management and output formatting for better monitoring
and debugging across various plugins, transitioning from standard output
to structured logging.
- Refined logging practices in multiple plugins to support better
maintainability and performance.
- Removed method for console logging from the Stopwatch class to
streamline logging practices.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backend This marks the issue or pull request to reference server code Bug Something isn't working Good First Issue Good for newcomers Integrations Pod General Issues related to the Integrations Pod that don't fit into other tags. Integrations Pod Integrations Product Issues related to a specific integration Inviting Contribution Issues that we would like contributions to Low An issue that is neither critical nor breaks a user flow Needs Triaging Needs attention from maintainers to triage Production Query & JS Pod Issues related to the query & JS Pod Tech Debt Issues or Tasks which are tech debts
Projects
None yet
6 participants