Assuming you had good sanitation practices during the production of the wort/beer, there should be no problem leaving the beer on the yeast for 4 weeks. However, if the ambient temperature was hot during this time, it's not ideal.
The big problem is yeast autolysis. This is when the yeast cells die, and break open, releasing off-flavour compounds into the beer. These flavours are often described as "meaty" - like that of yeast extract spread.
Generally the cooler the beer is kept, the less chance there is of autolysis (it also depends on pH). If you're beer was kept cool during this time (e.g.: 4 weeks below 20C), the the risk of autolysis is very low, and it should be OK.
If you have some kind of bacterial infection, the beer will be sour, and there may also be a white-ish film floating on top of the beer, called a "pellicle". You can google this term to see many photos. - https://www.google.com/search?client=ubuntu&channel=fs&q=beer+pellicle