Giter VIP home page Giter VIP logo

Comments (12)

ddossot avatar ddossot commented on August 18, 2024

We haven't met this problem, though we call application:stop(log4erl) as part of our normal application shutdown (which happens many time per day, as per our integration tests).

Using: log4erl master, file and console appenders + one custom appender.
Running on: R13B01, ERTS 5.7.2, Ubuntu Karmic.

from log4erl.

ahmednawras avatar ahmednawras commented on August 18, 2024

Hi maxlapshin,

I'm not sure I understand you complain here. Is this something you face a lot? Is there an error message you get for example? Can you please provide a sample code? I use log4erl a lot with different OSes (Solaris, linux, win) and don't recall a time when I faced such an issue.

from log4erl.

maxlapshin avatar maxlapshin commented on August 18, 2024

So, it seems, that I don't understand where to put application:stop(log4erl). =(

I call application:start(log4erl) in ems_app:start/2 callback and call application:stop(log4erl) in ems_app:stop/1 callback. Am I doing wrong?

from log4erl.

maxlapshin avatar maxlapshin commented on August 18, 2024

Yes, I've found: it is my fail, I shouldn't stop log4erl from stop/1 callback of main application.

from log4erl.

ahmednawras avatar ahmednawras commented on August 18, 2024

Hi maxlapshin,

That's what I normally do, call application:stop(log4erl) from my applications's stop function. Can you please explain what is the cause of failure in your side and how it was resolved?

Ahmed

from log4erl.

maxlapshin avatar maxlapshin commented on August 18, 2024

http://github.com/erlyvideo/erlyvideo/commit/bb69a955491e32f462985f6517d56bc12f3dce47

I had to move application:stop(log4erl) from ems_app.erl (application handler) to ems.erl (generic module) and hangs disappeared.

from log4erl.

ahmednawras avatar ahmednawras commented on August 18, 2024

Perfect. I will close this case now.

from log4erl.

maxlapshin avatar maxlapshin commented on August 18, 2024

And what is the problem? I have the same hang with my erlang-rtmp application/library

from log4erl.

ahmednawras avatar ahmednawras commented on August 18, 2024

Hi maxlapshin,

I reopened this case again. I'm not sure of the exact reason for the hangs but below you can find my analysis.

I've done a quick review for ems.erl, ems_app.erl and ems_log.erl and found out that you start log4erl and stop it in different modules. Also, I could see in some modules you stop and unload log4erl (ems.erl) and in other you just stop it (ems_log.erl). I suspect this is due to the issue of log4erl hanging.

I suggest you add application:start(log4erl) and application:stop(log4erl) in the same module only and delete the rest. Also, make sure you start before any other log4erl dependant code and stop after it. My initial guess is that this place is ems_log.erl, unless you're using log4erl logging before you actually initialize ems_log.erl module.

I don't normally use application:unload/1 but you may have your own reasoning for using it. If you opt to using it, I'd recommend you also add application:load/1 before application:start/1 just in case.

Please try it again and let me know if you still have problems.

Ahmed

from log4erl.

maxlapshin avatar maxlapshin commented on August 18, 2024

Yes, I will try of course, thank you for review.

from log4erl.

ahmednawras avatar ahmednawras commented on August 18, 2024

Closing

from log4erl.

maxlapshin avatar maxlapshin commented on August 18, 2024

Yes, close it, thank you again for help.

from log4erl.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.