The end of 2015 should have been a time for celebration for rapper Logic.

His second full-length album, The Incredible True Story, had just emerged to acclaim, and the 27-year-old (who grew up in poverty with substance-addicted parents in Maryland) was financially comfortable for the first time in his life.

But his brutal promotional schedule and own insecurities led to Logic (real name Sir Robert Bryson Hall II) having a severe anxiety attack while in line to see Star Wars: The Force Awakens in his adopted hometown of Los Angeles.

He ended up hospitalized, and was subsequently diagnosed with derealisation an anxiety-induced disorder with symptoms that include the sense of being out of ones body, all of the time.

I was so scared because I was thought I had to work, work, work, because I thought I might only be around for five years, he tells The Post of his intense schedule, which led to his breakdown. I thought I wasnt good enough to last.

I was on a tour bus crying, saying, I cant do this anymore

The rapper, who plays Barclays Center on Tuesday, still didnt let up, touring the album incessantly throughout 2016, while continuing to fight depression. I was on a tour bus crying, saying I cant do this anymore.

His third album is Everybody; a sprawling 90-minute concept album which earned him his first Billboard No. 1 back in May.

Add the six mixtapes in his back-catalog, and that makes an impressive total of nine releases since he first emerged in 2009.

His commitment to recording remains, but Logic has learned that in the age of constant scrutiny, he has to take breaks from the limelight for the sake of his mental health.

Hes not alone. Several high-profile artists and celebrities, including Ed Sheeran and Lena Dunham, have complained of social medias tendency to attract needlessly extreme comments and have taken steps back.

Right this moment, Ive got people tweeting at me that Im a piece of s–t, says Logic, citing everything from his biracial heritage, to his decision to play Super Mario Kart onstage with fellow rapper Lil Yachty as reasons for the anger.

I still use social media, but in a controlled way. I treat it like going to war.

But perhaps most importantly, Logic has learned to say no, even though demand for his appearances is at a peak.

I turn down really well-paid shows all over the world because I want to spend time with my wife and myself, he says. Is it so crazy to think my wife is worth more than that?

Just last week, Justin Bieber pulled the remainder of his Purpose world tour and explained in an Instagram post on Wednesday that he wanted to keep his mind, heart and soul sustainable.

Logic might not be in the same league of fame, but admits he can sympathize and is determined not to let the search for the next big check overrule his personal health like he once did.

I could sit here and think I got all these people around me that I need to pay, which is true, he says. But aint nobody getting paid if Im dead.