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

Logger Configuration doesn't work. #88

Open
Alivers opened this issue Mar 16, 2023 · 5 comments
Open

Logger Configuration doesn't work. #88

Alivers opened this issue Mar 16, 2023 · 5 comments

Comments

@Alivers
Copy link

Alivers commented Mar 16, 2023

Logger configuration defined in common config doesn't work.

Common config, set the logLevel as debug:

{
  "logLevel": "debug",
  "storeType": "Redis",
  "readinessPort": 2000,
  "apiPort": 3000,
  "promPort": 9101,
  "numGuardians": 1,
  "mode": "BOTH",
  "redis": {
    "port": 6379,
    "host": "127.0.0.1"
  },
  "spyServiceHost": "127.0.0.1:7073",
  "defaultWorkflowOptions": {
    "maxRetries": 10
  },
  "wormholeRpc": "https://wormhole-v2-testnet-api.certus.one",
  "supportedChains": [
    {
      "chainId": 2,
      "chainName": "Goerli Eth",
      "type": "evm",
      "nodeUrl": "https://eth-goerli.g.alchemy.com/v2/Tx6QBR_xgE2YemhNXTaQMGBhUFOTtddA",
      "bridgeAddress": "0x706abc4E45D419950511e474C7B9Ed348A4a716c",
      "privateKey": "0x123"
    },
}

start relayer, the config did't be effect.

relayer_engine is logging to the console at level [info]
2023-03-16 20:14:17.659|info|main: AriesRelayerPlugin loaded  
Validating envs...
Validated envs
2023-03-16 20:14:17.666|warn|GlobalStorage: You are starting a relayer without a namespace, which could cause issues if you run multiple relayers using the same Redis instance  
2023-03-16 20:14:17.667|info|main: Running as both executor and listener  
2023-03-16 20:14:17.668|info|Goerli Eth-0-worker: Spawned  
@solanoepalacio
Copy link
Collaborator

Hey @Alivers . Thanks for writing again!
I think I found this problem and fixed it in the branch I'm currently working on.
Give me a few minutes, I'll see if I can reproduce it in the main branch. If the issue is what I think it is, we would solve real quick... I'll come back to you soon

@solanoepalacio
Copy link
Collaborator

Actually... I just tried it in main branch and it worked fine for me :(...
One difference I notice is that in my case it reads the environments first and starts the logger...
image

In your case it seems to be the other way around, which would explain why it's not taking your environment config for the logger. Can you show me again how you are starting you relayer-engine?
thanks!!

@Alivers
Copy link
Author

Alivers commented Mar 16, 2023

hi @solanoepalacio, I found the problem that is I called the relayerEngine’s getLogger method which initialized the global logger firstly. So after that the logger instance wouldn’t be changed. Surely, I shouldn’t call that method manually, or maybe the method may not be exported?

@solanoepalacio
Copy link
Collaborator

It's not necessary to use the relayer-engine logger inside the plugin. You probably want to hook up there whatever logging mechanism you use across your services.
I think you are right and the method souldn't even be exported 🤔 ... I'll dig into the rationale of this and consider removing the export, thanks for the feedback!

@Alivers
Copy link
Author

Alivers commented Mar 16, 2023

Thank you so much!! Hope the engine gets more better.😆

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants