Skip to content

Instantly share code, notes, and snippets.

@chathurangat
Last active December 9, 2017 22:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chathurangat/a0f961c3c849a3061ec2b4e13c460dc9 to your computer and use it in GitHub Desktop.
Save chathurangat/a0f961c3c849a3061ec2b4e13c460dc9 to your computer and use it in GitHub Desktop.
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class Application
{
private final static Logger logger = LoggerFactory.getLogger(Application.class);
public static void main(String[] args) throws Exception
{
logger.info("Application Running on : [{}]", Thread.currentThread().getName());
MyThread work = new MyThread();
//directly calling the run() method
work.run();
}
}
class MyThread extends Thread
{
private final static Logger logger = LoggerFactory.getLogger(MyThread.class);
@Override
public void run()
{
logger.info("MyWork Running on : [{}]", Thread.currentThread().getName());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment